LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Menu and button callback

Hi,
I'm using menus and buttons in the same application. Sometimes it
happens that a menu entry and a button must perform the same action.
In this case, I have to create a callback for the menu entry, another
callback for the function and a third function called by the two
calbacks. This because the menu and button callback prototypes are
different. Is there a more elegant way of doing this?
Any suggestion appreciated.
0 Kudos
Message 1 of 4
(3,410 Views)
Put your code in the button callback, while in the menu callback you can use CallCtrlCallback () to call the button callback. That way you avoid the third function.

Roberto


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?
0 Kudos
Message 2 of 4
(3,410 Views)
Thanks for your help.
I would just add here, for those who might need it, that the
CallCtrlCallback () is located in the toolbox.fp file (it took me a
while to find it).
Regards.
0 Kudos
Message 3 of 4
(3,410 Views)
You're right. I'm sorry: since I add the toolbox instrument to all of my projects, some times I forget that not all the functions I use are in the standard CVI IDE...
Roberto


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?
0 Kudos
Message 4 of 4
(3,410 Views)