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


EnableItem

Use the EnableItem procedure to enable a menu item or a menu.

PROCEDURE EnableItem (theMenu: MenuHandle; item: Integer); 
theMenu
A handle to the menu record of the menu containing the menu item
to enable.
item
The item number of the menu item to enable, or 0 to enable the entire menu. You cannot individually enable a menu item with an item number greater than 31.
If you specify 0 in the item parameter, the EnableItem procedure enables the menu title and all items in the menu that were not previously individually disabled.
DESCRIPTION
The EnableItem procedure enables a specified menu item so that it no longer appears dim and so that the user can choose the menu item.

Note that, if you enable a menu, the EnableItem procedure enables the menu title but only enables those menu items that are not currently disabled as a result of your application previously calling DisableItem and specifying each item's item number. For example, if all items in your application's Edit menu are enabled, you can disable the Cut and Copy commands individually using DisableItem. If you choose to disable the entire menu by passing 0 as the item parameter to DisableItem, the menu and all its items are disabled. If you then enable the entire menu by passing 0 as the item parameter to EnableItem, the menu and its items are enabled, except for the Cut and Copy commands, which remain disabled. In this case, to enable the Cut and Copy commands you must enable each one individually using EnableItem.

If your application enables a menu using EnableItem, it should call DrawMenuBar to update the menu bar's appearance.

SEE ALSO
See "Enabling and Disabling Menu Items" on page 3-58 for examples of enabling items in a menu.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996