Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 3 - Menu Manager / Menu Manager Reference
Menu Manager Routines / Getting and Setting the Appearance of Menu Items


SetItemCmd

Use the SetItemCmd 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 the SetItemCmd 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 the cmdChar 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
The SetItemCmd procedure sets the value in the keyboard equivalent field of the specified menu item in the cmdChar 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.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996