Adding a Menu Bar and Menus
You add and modify menus using the menu editor. Menu bars can be added
only to frames. If you opened a different type of container, you can
change its type to a frame by selecting the container name in the GUI
builder's container list and choosing GUI -> Set Window
Type. Click on the frame button and click OK.
This section covers:
To open the Menu Editor:
- Select the frame in the layout window by clicking in the area
between the layout grid and the window frame.
- Open the attribute editor by clicking on its button in the main
toolbar.
- Click on the Edit menubar button.
Creating Menus
The menu list that you create in the menu editor is hierarchical:
- Items that begin in the first column are menus on the
menu bar.
- Items that begin in the second column are items in the
menu that precedes it hierarchically.
- Items that begin in subsequent columns are pull-right items
of the menu item that precedes them hierarchically.
- Separators are added at the same hierarchical level as
the menu items they separate.
This Menu Editor list: Produces this menu:



To create a menu:
- In the menu editor, click in the Name box and enter a unique ID
for the menu (for example, fileMenu).
- Click in the Text box and enter a name for the menu item
(for example, File, View, and so on).
Click on button to the right of the font box to specify the font
family, style, and size.
- Click Insert to insert the next menu.
Add more menus by repeating steps 1 and 2. A list of the menus appear
in order in the display area of the menu editor. Click Apply to add
the menu bar (and any subsequent menus or menu items) to the
GUI.
To create a menu item for a menu:
- Select a menu name in the display area of the menu editor.
- Click Insert to insert a menu item.
- Click in the Name box and enter a unique ID for the menu item.
- Click in the Text box and enter a name for the menu item.
- Click the right-pointing arrow to indent the item.
Add more menu items by repeating steps 2 through 5. A list of the menu
items appear, indented, under the name of the menu that
contains them. Click Apply to add the menu items.
Repeat the procedure to add items to each menu in the menu bar.
Use the arrow keys to reorganize the placement of the menus and menu
items.
To add a Help menu:
- Click on Add Help Menu to automatically add a Help menu to the
far right end of the menu bar. You add items to the Help menu just as
you did for the other menus.
- After you add the Help menu to the list, type Help in the
Text box for the menu label.
The Help menu must be the last menu in the list. If you attempt to add
additional menus, an error is generated when you apply the changes.
To change the font type:
- Select a menu name in the display area of the menu editor.
- Click on the button next to the font box.
- Choose the font family, style, and point size and click OK.
To add a separator bar in a menu:
- Select a menu item name in the display area of the menu editor.
- Click on the Separator button and click OK. In preview mode, a
separator bar appears below the selected menu item.
To create a tear off menu:
- Select a menu name in the display area of the menu editor.
- Click on the Tearoff Menu button and click OK. In preview mode,
the selected menu displays a broken line below the menu name.
See also:
- Adding Operations to Menus
- Laying Out the Interface
- What Is a Component Operation?
- Adding Custom Components and Windows