From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-17-2013 10:47 AM - edited 05-17-2013 10:51 AM
I was asked this morning for a bit of functionality that has been in LV for years but not exposed as a standalone function: how to set or clear the default menu associated with a LabVIEW class. So I did a "create subVI", cleaned up the code a bit, and put an icon on it. Figured it might be useful to other folks, so I'm posting it here. It is saved for LV 2009 and there is no password on the VI.
Solved! Go to Solution.
05-17-2013 10:48 AM
This "question" is answered.
05-17-2013 10:57 AM
Sorry if I'm being dense, but what "default menu" does this refer to?
05-17-2013 12:42 PM
Er, this IS already exposed and I do it all the time, setting a menu for right-clicking on the object wire.......
Without looking at the VI posted, what exactly does it DO?
05-20-2013 10:08 AM
@for(imstuck) wrote:
Sorry if I'm being dense, but what "default menu" does this refer to?
The popup menu that you can get when you right click on a class wire. Normally there isn't one unless the developer of the class has set one in the Class Properties dialog. This bit of code sets that menu programmatically.
05-20-2013 10:08 AM
@Intaris wrote:
Er, this IS already exposed and I do it all the time, setting a menu for right-clicking on the object wire.......
Really? How? I sure didn't know of a direct route to it. Yes, it is in the Class Properties dialog, but a method to set it programmatically?
05-20-2013 12:02 PM
I usually go the XML down-and-dirty route. I would make a small change to the string label though:
Name of .mnu file to set as Default Menu -- empty string to delete existing -- be certain to save the library after running
05-20-2013 01:29 PM
@Darin.K wrote:
Name of .mnu file to set as Default Menu -- empty string to delete existing -- be certain to save the library after running
True of any scripting operation.
05-20-2013 02:00 PM
You know that, I know that, but I have plenty of evidence that many people do not. Not that I mind the Kudos and Solutions.
The real goal was to see how long a label would have to become before you resorted to a caption, free label, control description or VI description.
05-20-2013 04:10 PM
@Darin.K wrote:
The real goal was to see how long a label would have to become before you resorted to a caption, free label, control description or VI description.
Oh, that's short for me. Ask anyone on LV R&D... as length of variable name/function name increases, the probability of it being written by me rises, hitting certainty somewhere around I think 40 characters. And that's in the text languages. In G, where I'm not typing the names? Oh, I've been known to put paragraphs in labels in my own personal code. I don't ship stuff like that out to you folks because I know it isn't kosher. 🙂