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:
Create a simple menu or menu bar using one of the following simple menu convenience methods:
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 | Description | Value(s) |
---|---|---|
buttons | An array of strings specifying the item labels. | String
|
buttonType | An array of constants specifying the item types. | XmCASCADEBUTTON
|
buttonMnemonics | An array of characters specifying the item mnemonics. | Character
|
postFromButton | 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. | Integer |
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).