Programmer Reference : Common Widgets : Menus : Simple menus and menu bars
Simple menus and menu bars
Simple menu convenience methods create row-columns which are configured as simple menu bars or simple menus. These convenience methods are the preferred method of creating a menu system for the following reasons:
Simple menus are easier to program
Simple menus use fewer operating system resources on some platforms
Simple menus are created faster on some platforms
Create a simple menu or menu bar using one of the following simple menu convenience methods:
Creates a simple menu bar
Creates a simple pull-down menu
Creates a simple pop-up menu
The menu or menu bar is entirely defined by the creation message and resources set in the argBlock. The resources that can be set to define a simple menu or simple menu bar are listed in the following table. The first three resources are arrays whose elements each represent a single menu bar item. These arrays must contain the same number of items, and must describe corresponding items in the same sequence, in order for the menu or menu bar to be correctly defined.
Table 37. Simple Menu and Simple Menu Bar Resources
Resource Name
An array of strings specifying the item labels.
String is ignored for separators, but must be present.
An array of constants specifying the item types.
A cascade button for a submenu
Default type for menu bar
A normal menu item
Default type for menu
A line separating menu items
A double line separating items
A radio-button menu item
A check-button menu item
A title menu item
An array of characters specifying the item mnemonics.
Character is ignored if it is not in the corresponding item string. The code "0 asCharacter" is useful for specifying no mnemonic.
Only used for pull-down menu creation. An integer specifying the zero-based index of the cascade button specified as the parent of the pull-down menu.
Row-columns configured as simple menus or menu bars provide a simple callback that is run whenever any item in a menu is selected. The clientData argument of the callback method is an integer indicating the zero-based position of the selected button in the menu (separators are ignored when determining the button positions).
When you add a simple callback to a row-column configured as a simple menu or simple menu bar, the clientData argument is ignored.
Last modified date: 01/29/2015