LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Using GetUserEvent and menu simultaneously with the same panel

Hallo all,
I am writing a program which has a panel with a menu. Most of the menu entries have a callback function. I also placed some buttons, checkboxes and numeric fields on the panel and I use GetUserEvent to catch the user's input. While GetUserEvent works fine the menu does not behave like intended. The funny thing is that some of the menu's entries still work and some don't. Especially the menu entry "File/Exit" does not react any more when the while-loop containing the GetUserEvent command is running.
GetUserEvent returns the ID of panel or menu. What I do not understand is how can I destinguish between menu and e.g. button on a panel when panel ID and menu ID are the same? In my case LabWindows/CVI gave both, panel as well as menu, the same ID in the automatically generated header file. Is my understanding of how menus and panels work wrong probably wrong?
Instead of using GetUserEvent I could also use callback's with each item on the panel. But then I would have to use more global variables and I thought that it is good programming not to have too many of them.

Thanks in advance
Thomas
0 Kudos
Message 1 of 2
(2,894 Views)
TWagner,

When you are referring to a panel in your code, you shouldn't use the #define created in the GUI header file to refer to it. Instead, you should use the variable panel handle that is returned when you use LoadPanel. I find that a lot of times the two numbers do match up, but there are some instances where this is not true. Especially when using things like EasyTab. I don't have much experience with menus, but I would imagine that this may be the root of your problems
0 Kudos
Message 2 of 2
(2,889 Views)