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


GetItemIcon

Use the GetItemIcon procedure to get the icon or script code of a specific menu item. If the menu item's keyboard equivalent field contains $1C, the returned number represents the script code of the menu item. Otherwise, the returned number represents the item's icon number.

PROCEDURE GetItemIcon (theMenu: MenuHandle; item: Integer;
                        VAR iconIndex: Byte);
theMenu
A handle to the menu record of the menu containing the menu item whose icon or script code you wish to get.
item
The item number of the menu item. The GetItemIcon procedure returns the icon number or script code of this item.
iconIndex
For menu items that do not specify $1C in the keyboard equivalent field, the GetItemIcon procedure returns the icon number of the item's icon in this parameter. The icon number returned in this parameter is a value from 1 through 255 if the menu item has an icon associated with it and is 0 otherwise. You can add 256 to the icon number to generate the resource ID of the 'cicn', 'ICON', or 'SICN' resource that describes the icon of the menu item. For example, if the GetItemIcon procedure returns 5 in this parameter, then the icon of the menu item is described by an icon resource with resource ID 261.
For menu items that contain $1C in the keyboard equivalent field, the GetItemIcon procedure returns the script code of the menu item. The Menu Manager displays the menu item using this script code if the corresponding script system is installed.
DESCRIPTION
The GetItemIcon procedure returns the icon number or script code of the specified menu item in the iconIndex parameter (or 0 if the item doesn't have an icon or a
script code).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996