04-29-2010 05:12 AM
04-29-2010 05:17 AM - edited 04-29-2010 05:18 AM
yes, you have to choose another event, e.g. EVENT_LEFT_DOUBLE_CLICK,
e.g.
int CVICALLBACK Button ( int panel, int control, int event, void *callbackData, int eventData1, int eventData2 )
{
if ( event == EVENT_LEFT_DOUBLE_CLICK )
{
...
}
return ( 0 );
}
04-29-2010 05:19 AM
Where can I choose an event ?
Please, see attache properties of the button.
Thanks.
04-29-2010 07:07 AM
Your callback will be called for lots of windows events. You can not change this behavior, instead you have to choose which event(s) you want to respond to by looking at the event parameter in the callback function. Wolfgang's answer shows you how to do it. Additional information is passed in the other callback function parameters - see the on-line help for details.
04-29-2010 07:50 AM
sfl,
Right-click the button in UIR editor and choose View Control Callback.
You will be directed to the C-file that has the code for the button's callback.
In this (highlighted) callback function, you will see a switch-case statement.
Remove the block for the case EVENT_MOUSE_OVER. Simply select with cursor and delete.
To change the defualt event setting (to avoid getting this event for newly created buttons) :
Open your UIR file, and select Code > Preferences > Default Events from the menu.
There you can select for which events the code generator will create a case statement further on.
Hope this helps,