LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Menu selection event

Is there any way to generate a Menu Selection Event for a menu item that has a sub-menu?
0 Kudos
Message 1 of 6
(3,330 Views)

I don't think so.

What are you trying to do?

This is not a "normal" request.

0 Kudos
Message 2 of 6
(3,316 Views)

I want to update the Enable/Disable, Checked/Unchecked states of the sub menu items before the sub menu gets displayed to the user.

0 Kudos
Message 3 of 6
(3,314 Views)

You can handle the "Menu Activation?" (Filter) event to set the menu item info before it is displayed.

The attached VI has a custom menu. Set the "Checked?" boolean to the desired value and then activate the menu to see the effect.

0 Kudos
Message 4 of 6
(3,299 Views)
In your example...  Is there a way to generate an event for Item3 only?
0 Kudos
Message 5 of 6
(3,281 Views)

Change the Item Tag string to "Item 3".

The event will be generated every time the user activates the menu. It is upto the programmer to handle specific menu items.

 

Another approach is to use the "Get Menu Selection" function. You can create a completely seperate loop to handle the menu items. The get menu selection function waits until the user selects a menu item or the function timeout. The difference is that this function finishes execution after the user selects a menu item. So you cannot filter the event.

The "Menu Selection Demo" example shipped with LabVIEW demonstrates the use of the "Get Menu Selection" function.

0 Kudos
Message 6 of 6
(3,278 Views)