int InstallPanelCallback (int panelHandle, PanelCallbackPtr eventFunction, void *callbackData);
Installs a panel callback.
InstallPanelCallback takes a panel handle, the name of the event function, type PanelCallbackPtr, that processes events for that panel, and callback data of any type.
After you install the callback, the event function is called whenever the user generates an event on the panel.
The event function receives the panel handle of the panel generating the event; the type of the event, such as a left mouse click, and any additional event data, such as the mouse position at the time of a left mouse click; and the callback data for processing.
You do not need to call InstallPanelCallback if you already associated a callback function with the panel in the User Interface Editor.
Callbacks are initiated through RunUserInterface or GetUserEvent.
![]() |
Note To uninstall the callback, pass NULL for eventFunction. |
Input | ||||||||||||||||||||||||||||
Name | Type | Description | ||||||||||||||||||||||||||
panelHandle | integer | Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel. | ||||||||||||||||||||||||||
eventFunction | PanelCallbackPtr | Name of the function that processes the panel events. The event function, type PanelCallbackPtr, takes the following form: int CVICALLBACK EventFunctionName (int panelHandle, int event, void *callbackData, int eventData1, int eventData2); The event function receives the panel handle of the panel generating the event; the type of the event, such as a left mouse click, and any additional event data, such as the mouse position at the time of a left mouse click; and the callback data for processing. The following is a list of events and associated event data:
User callbacks must always return 0 unless they intend to swallow the event to which they are responding. To swallow the event, the callback should return 1.
|
||||||||||||||||||||||||||
callbackData | void * | Points to data that you define. The callback function receives the pointer. |
Name | Type | Description | ||||
status | integer | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
|