I would like to ask, how can I selectively enable/disable custom menu items. For example, I added "Tools/example item 1" and "Tools/example item 2" to LabVIEW tools menu and I want, based on certain conditions disable/enable these items - based on where they are called from (whether from init screen, from VI or from project). I also want to conditionally disable "example item 2", so that it will disabled until "example item 1" is called and executed. I know this is possible since several LabVIEW toolkits use this. Can someone please advise me on how this is done?
Are you referring to the right-click menu item? If so, that's pretty straight forward. Typically I would do that in the OnPopupMenu.vi method. Here's an example of that:
The source code for this provider is available on my GitHub: https://github.com/TomsLabVIEWExtensions/Toggle-Debugging
Hope this helps 🙂
Sorry, I re-read your message and you specifically asked about the LV Tools menu.
I haven't been able to find a way to do that (yet) as typically you initialize your tools menu in the init.vi method (which is only run once).
I will edit this reply if I come across anything.
Thank you for your reply McQuillan,
yes, I am looking for the disabling of tools menu items. What I want to do looks like this example from Tools/Advanced menu with items "Export Strings..." and "Import Strings...":
Yeah, I would tend to agree with Hypiz. I'm normally pretty good at finding the source code for the native LV plugins to use as examples - I was able to find Mass Compile. But I couldn't find Export Strings anywhere in program files (I did a global "everything" search on my PC, then manually looked in the <labview>\project directory and the providers directory).