LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create Menu bar and add Menu Items in runtime without a *.uir file

Programitally we have create and add menu items and add the call backs necessary
0 Kudos
Message 1 of 3
(2,958 Views)
Not sure exactly of your requirement, if the issue is not distributing a UIR file, you could create a UIR file and then use the "UIR to Code Converter" that is available in the Tools menu.

--IW
0 Kudos
Message 2 of 3
(2,958 Views)
Cinu,

Menu bars are associated with a panel and can be created and edite4d programmatically without linking it statically to a panel in the UIR file. There are a set of functions for this in the UI library; you could start with something like this:

menuHandle = NewMenuBar (panelHandle);
FILE = NewMenu (menuHandle, "File", -1);
FILE_OPEN = NewMenuItem (menuHandle, FILE, "Open", -1, VAL_F1_VKEY, OpenFileCallBack/*Callback function*/, NULL);


There are other fuctions to set the attributes of the menu bar, the menues or the menu items. You can also use the UI to code converter to generate som example code on generating the menubar, just create a uir with a single panel and a menu bar; then go to tools and UI to code converter and take a look at the
c file generated.

Hope this helps, let me know if you have more questions.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 3 of 3
(2,958 Views)