Important: The information in this document is obsolete and should not be used for new development.
SetItemCmd
Use theSetItemCmd
procedure to set the value of the keyboard equivalent field of a menu item. You usually define the keyboard equivalents and other characteristics of your menu items in'MENU'
resources rather than using theSetItemCmd
procedure.
PROCEDURE SetItemCmd (theMenu: MenuHandle; item: Integer; cmdChar: Char);
theMenu
- A handle to the menu record of the menu containing the menu item whose keyboard equivalent field you wish to set.
item
- The item number of the menu item. The
SetItemCmd
procedure sets the keyboard equivalent field of this item to the value specified in thecmdChar
parameter.cmdChar
- The value of the item's keyboard equivalent field. The Menu Manager uses this value to map keyboard equivalents to menu commands or to define special characteristics of the menu item.
- To indicate that the menu item has a submenu, specify $1B in the
cmdChar
parameter; specify a value of $1C to indicate that the item has a script code; specify a value of $1D to indicate that the Menu Manager should reduce the item's'ICON'
resource to the size of a small icon; and specify a value of $1E to indicate that the item has an'SICN'
resource.- The values $01 through $1A, as well as $1F and $20, are reserved for use by Apple. You should not use any of these reserved values in the
cmdChar
parameter.DESCRIPTION
TheSetItemCmd
procedure sets the value in the keyboard equivalent field of the specified menu item in thecmdChar
parameter (you can specify 0 if the item doesn't have a keyboard equivalent, submenu, script code, reduced icon, or small icon). If you specify that the item has a submenu, you should provide the menu ID of the submenu as the item's marking character. If you specify that the item has a script code, provide the script code in the icon field of the menu item. If you specify that the item has an'SICN'
or a reduced'ICON'
resource, provide the icon number in the icon field of the item.