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 / About the Menu Manager


How the Menu Manager Maintains Information About Menus

The Menu Manager maintains information about menus in menu records. Each menu record includes certain information about a specific menu, including

You typically specify most of this information in a menu resource, that is, a resource of type 'MENU'. When you create a menu, the Menu Manager stores this information in a menu record. A menu record is a data structure of type MenuInfo. You usually never need to access the information in the menu record directly; the Menu Manager automatically updates the menu record when you make any changes to the menu, such as adding a menu item. See "The Menu Record" beginning on page 3-97 if you need to access the fields of the menu record directly.

The Menu Manager identifies every menu by a number referred to as a menu ID. You must assign a menu ID to each menu in your application. Each menu in your application must have a menu ID that is unique from that of any other menu in your application. You can use any number greater than 0 for a menu ID of a pull-down or pop-up menu; submenus of an application can use only menu IDs from 1 through 235; submenus of a desk accessory must use menu IDs from 236 through 255.

When you create a menu, the Menu Manager creates a menu record for the menu and returns a handle to that menu record. To refer to a menu, you usually use either the menu's menu ID or a handle to the menu's menu record.

To refer to a menu item, use the menu item's item number. Item numbers identify items in menus; items are assigned item numbers starting with 1 for the first menu item in the menu, 2 for the second menu item in the menu, and so on, up to the number of the last menu item in the menu.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996