LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

define contents of menu bar from text file

Solved!
Go to solution

Hi, 

 

I would like to list the contents of the menu bar dynamically by reading it from a text file. Is there a way to do this? 

 

Thanks!

 

Sinnas

0 Kudos
Message 1 of 7
(4,004 Views)

I suppose you can do it by using InstallMenuDimmerCallback () function: this command installs a function that is called by the system before the menu is shown so that you can dim / undim the appropriate menu items depending on the execution state. See this tip of mine and the following commend from LuisG

This is the original purpose: you could customize the menu bar instead by using SetMenuBarAttribute () to change the item name(s) and event the associated callback function. I have never used this function that way, though, so I cannot tell you how efficent the mechanism can be and how much delay will it introduce before the menu is shown.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 7
(4,003 Views)

In addition to what Roberto mentioned I'd like to point you to the ini-instrument driver which allows to conveniently read (formatted) text files, see also the example ini.cws that ships with CVI

0 Kudos
Message 3 of 7
(3,992 Views)

Thank you Roberto and Wolfgang. I will give your suggestions a shot and get back to you. 

0 Kudos
Message 4 of 7
(3,989 Views)

Hi again.. I went through your suggestions but dont see them as solving my problem. What i want to do is add child items to my menu dynamically. For example at the moment my menu has 4 parent items and one of the parents has 3 child items. I would like to define these 3 child items through my text file. For instance if my text file has 4 sections then the parent will have 4 child items (inplace of the present 3). 

 

Is something like this possible? 

 

Thanks!

 

Sinnas

0 Kudos
Message 5 of 7
(3,981 Views)
Solution
Accepted by topic author sinnas

Yes, it's possible. Have a look at the commands NewMenu and NewSubMenu... (and the overview here). There is also an example (UIRView)

0 Kudos
Message 6 of 7
(3,979 Views)

Oh yes perfect! just what i was looking for. Thank you wolfgang.

0 Kudos
Message 7 of 7
(3,974 Views)