|
发表于 2008-9-17 23:43:51
|
显示全部楼层
Using Callback Functions to Respond to User Interface Events
Callback functions respond to all events generated by the User Interface Library. The C prototypes for the callback functions are in userint.h. You can assign callback functions to panels, menu bars, controls, or the main callback. When the user generates an event on a particular user interface object, the appropriate callback function executes. Idle events and end-task events are passed to the main callback function only. InstallMainCallback installs this main callback function.
LabWindows/CVI passes event information from the GUI to the callback functions. For example, callback functions receive the type of user interface event that occurred, such as EVENT_LEFT_CLICK, and some additional information concerning that event, such as the x- and y-coordinates of the mouse cursor when the click occurred. You are free to design your functions to use this information when responding to events. LabWindows/CVI also passes callback data to the callback function that you define. |
|