clbst47 Posted February 18, 2005 Report Share Posted February 18, 2005 ...anybody know if this is possible? I can find the "Run-time menu path" of any VI using VI server, but can't seem to get the refnum so I can manipulate a VI's menu from a subVI, for example. I gotta imagine this is possible, and I'm just not looking in the right place... Quote Link to comment
Louis Manfredi Posted February 18, 2005 Report Share Posted February 18, 2005 Hi Clbst47: Yes, you can do it. Application control>Menu>Current Vi's Menubar will allow you to put a reference to the current vi's menubar on the block diagram. On the panel of your Sub-vi, you can insert a control that you can wire up to this reference (Controls>Refnums>Menubar Refnum.) Then you can put whatever menu control stuff you want inside the sub-vi. Can reduce a bunch of clutter on the Main Vi's diagram. Can also save a lot of work by having the sub-vi used by many callers needing similar menu service. I've used it to great benefit for both. Easiest shortcut is to start with the menu stuff on the main vi, select what you want to put in the sub-vi (not including the Refnum constant) and then use create sub-vi. Be careful about trying to do two things at once with a menu-- most cases were this is a bad idea, with unpredictable results. So be sure to always daisy-chain menubar out from one menu operation to the in of the next operation. This might mean that you need a menubar out indicator on your sub-vi. (I think you might be able to save the menubar as Global, but that's a really dangerous idea. Even those of us that like Globals for some purposes cringe at this & I hate to think how the no-globals-ever-no-matter-why guys would feel about it. Good luck, hope this helps. Quote Link to comment
clbst47 Posted February 18, 2005 Author Report Share Posted February 18, 2005 Hi Clbst47:Yes, you can do it. Application control>Menu>Current Vi's Menubar will allow you to put a reference to the current vi's menubar on the block diagram. On the panel of your Sub-vi, you can insert a control that you can wire up to this reference (Controls>Refnums>Menubar Refnum.) Then you can put whatever menu control stuff you want inside the sub-vi. Can reduce a bunch of clutter on the Main Vi's diagram. Can also save a lot of work by having the sub-vi used by many callers needing similar menu service. I've used it to great benefit for both. Easiest shortcut is to start with the menu stuff on the main vi, select what you want to put in the sub-vi (not including the Refnum constant) and then use create sub-vi. Be careful about trying to do two things at once with a menu-- most cases were this is a bad idea, with unpredictable results. So be sure to always daisy-chain menubar out from one menu operation to the in of the next operation. This might mean that you need a menubar out indicator on your sub-vi. (I think you might be able to save the menubar as Global, but that's a really dangerous idea. Even those of us that like Globals for some purposes cringe at this & I hate to think how the no-globals-ever-no-matter-why guys would feel about it. Good luck, hope this helps. 3943[/snapback] Thanks for the reply - I would really like to be able to do this w/out passing in a menu refnum. Is this possible? I simply can't believe that the menubar is not an exposed property of a VI somewhere! Quote Link to comment
jpdrolet Posted February 18, 2005 Report Share Posted February 18, 2005 Thanks for the reply - I would really like to be able to do this w/out passing in a menu refnum. Is this possible? I simply can't believe that the menubar is not an exposed property of a VI somewhere! 3944[/snapback] The menu refnum is not on the VI property list yet. It is on the wish list since 2001. See item 5.1 in the document attached here. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.