LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

related to callback fns

how many times does a callback function is called in a single event .And also inform if event is 8 and 9 then what are they ?
regards
subrata
0 Kudos
Message 1 of 3
(2,996 Views)

Hello Subrata,

the events are defined in the file userint.h, starting from line 1461. There, you can see that 8 is EVENT_GOT_FOCUS and 9 is EVENT_LOST_FOCUS. These events are explained in the CVI Help:

  • If a control's callback function is called with the event parameter set to EVENT_GOT_FOCUS, this means that the control is made the active control. It now has the input focus. The eventData1 parameter tells you which control was previously active.
  • If a control's callback function is called with the event parameter EVENT_LOST_FOCUS, it means that the control is not the active control anymore and it lost the input focus. Now, the eventData1 parameter is the new active control.

For each event, the control's callback funtion is called only once. Note that one simple action can cause the control's callback function to be called several times. For example, if you left click a button control that is not currently the active control, the callback function will be called with the EVENT_GOT_FOCUS event, then with the EVENT_LEFT_CLICK event, and then with the EVENT_COMMIT event.

I hope this answers all your questions. If not, don't hesitate to reply Smiley Wink

Message 2 of 3
(2,996 Views)
To add to Wim's answer: In the UIR editor you can click the "Operate Tool" toolbar button, and then "use" your UI, and watch the events that are generated in the top right of the UIR's window.
0 Kudos
Message 3 of 3
(2,984 Views)