11-15-2022 04:57 AM - edited 11-15-2022 04:57 AM
Hello all!
Is it possbile to lock the (custom) runtime menu when, for example, a triggered loop is running so that the software cannot be left by going to the menu and select "Exit" right in the middle of the loop? The menu related VIs seems to give no control of such kind.
Solved! Go to Solution.
11-15-2022 05:54 AM
You can intercept the filter event "Shortcut Menu Activation?" for your control. Watch out for the question mark at the end of the event name. The Discard? terminal on the right side of that event case lets you tell LabVIEW to simply disallow the activation.
11-15-2022 06:58 AM
Thanks and understood. But this won't lock the menu, only prevent actions. I can still click menu items. OK, better than nothing.
11-15-2022 07:26 AM - edited 11-15-2022 07:30 AM
Please explain yourself. If you tell LabVIEW to discard the menu event, the menu won't even appear on the screen, so not sure how you even could still select anything in the not available menu.
If you only want to disable particular menu items you can do that too. One of the elements on the left event node is the menu refnum. You can use that with the menu control VIs to change the name, disable/enable, checkmark and what else attributes of one or more menu items or even remove items from or add new items to that menu.
11-15-2022 01:00 PM
@rolfk wrote:
Please explain yourself. If you tell LabVIEW to discard the menu event, the menu won't even appear on the screen, so not sure how you even could still select anything in the not available menu.
If you only want to disable particular menu items you can do that too. One of the elements on the left event node is the menu refnum. You can use that with the menu control VIs to change the name, disable/enable, checkmark and what else attributes of one or more menu items or even remove items from or add new items to that menu.
Actually, that doesn't work: You get error 1164 "You cannot modify an application menu item."
11-15-2022 01:13 PM
11-15-2022 01:23 PM
You can't grey it out, but you can remove it.
11-15-2022 01:37 PM
The OP said it was a custom run-time menu, so I assumed they had their own "Exit" item coded in there.
11-15-2022 01:39 PM
@paul_cardinale wrote:
You can't grey it out, but you can remove it.
Sure you can grey it out.
11-15-2022 01:43 PM
@billko wrote:
@paul_cardinale wrote:
You can't grey it out, but you can remove it.
Sure you can grey it out.
No you can't. You get error 1164 "You cannot modify an application menu item."