|
User Interface Programming: Using the IDL GUIBuilder |
|
You can add menus to top-level bases or to buttons that have the Type attribute set to Menu. To define menus for your interface, use the Menu Editor, which is shown in the following figure with defined menus. This dialog allows you to define menus, menu items, submenu titles, and submenus, and all their associated event procedures.
For instructions on how to define the menus shown in the following figure, see Defining Menus for the Top-level Base.
To define basic menus, menu items, submenu titles, submenus, and their associated event procedures to top-level bases, follow these general steps:
| Note The Menu Caption is the name that appears on the menubar. If you are defining a top-level menu for a base, you do not need to supply a value in the Event Procedure field. On button menus, however, where the button's Label attribute acts as the top-level menu, the first level of menus in the editor serve as menu items, and thus require a value in the Event Procedure field. |
| Note For top-level bases, you must indent a line to make it a menu item and enable the Event Procedure field. |
| Note Under Microsoft Windows, including the ampersand character (&) in the Menu Caption causes the window manager to underline the character following the ampersand, which is the keyboard accelerator. This functionality is supported in the Menu Editor. If you are designing an application to run on other platforms, however, avoid the use of the ampersand in the Menu Caption. |
You can also create buttons that contain menus. To add a menu to a button, follow these basic steps:
| Note For buttons, the Label attribute acts as the top-level menu, and the first level of menus in the Menu Editor serve as menu items. Therefore, the first level requires a value in the Event Procedures field (unlike top-level menu items for bases). |
To view menus on buttons, do one of the following:
IDL Online Help (March 06, 2007)