LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

how to call a button’s click event programmatically

Solved!
Go to solution
Dear All,
I would like to know how to call a button’s click event
programmatically in LabWindows/CVI.

Thank you very much,
Mariela.
0 Kudos
Message 1 of 5
(6,289 Views)
Solution
Accepted by prodna
Either you directly call the button callback or (better) use CallCtrlCallback passing the appropriate event (normally EVENT_COMMIT: it depends on which event you are handling inside the control callback).


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 5
(6,284 Views)

I have a follow up question.

 

the prototype is 

 

int CallCtrlCallback (int Panel, int Ctrl, int Event, int EventData1, int EventData2, int *Return_Value);

 

For an event = EVENT_COMMIT what are the meaning of values EventData1 and EventData2? Or do I just set them to NULL?

0 Kudos
Message 3 of 5
(6,199 Views)

I have never checked what the values are when I get an EVENT_COMMIT event but I have used this function and simply set both of those to zero.

 

Works fine, I do know that for mouse clicks (not commits!) those are populated with the mouse pointer coordinates.

Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 4 of 5
(6,176 Views)

Meaning of eventData parameters is listed in userint.h where events are defined. Several events have associated eventData values (some of them only when fired for specific control types).



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 5 of 5
(6,174 Views)