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


InitMenus

The InitMenus procedure allocates space for your application's current menu list in your application's heap. Your application needs to call InitMenus only once to initialize the Menu Manager and the current menu list for your application.

PROCEDURE InitMenus; 
DESCRIPTION
The InitMenus procedure creates the current menu list with no menus, submenus, or pop-up menus. InitMenus also creates your application's menu color information table. After allocating the menu color information table, InitMenus looks for an 'mctb' resource with resource ID 0. You can provide an 'mctb' resource with a resource ID of 0 as one of your application's resources if you want to use colors other than the default colors for your application's menu bar and menus. If InitMenus finds and successfully loads an 'mctb' resource, it adds the information contained in that resource to the menu color information table (using SetMCEntries).

The InitMenus procedure also draws an empty menu bar.

SPECIAL CONSIDERATIONS
Your application must initalize QuickDraw, the Font Manager, and the Window Manager (using the InitGraf, InitFonts, and InitWindows procedures) before initializing the Menu Manager.

SEE ALSO
To set up the menus for your application's menu bar, use GetNewMBar and SetMenuBar, described on page 3-113 and page 3-114, respectively. You can also add menus to the current menu list using the InsertMenu procedure, described on page 3-110.

To remove all menus from the current menu list, use the ClearMenuBar procedure, described on page 3-112.

If your application uses its own menu bar definition function, use the InitProcMenu procedure to set the mbResID field of the current menu list to the resource ID of your custom 'MBDF' resource.

See "The Menu Color Information Table Resource" on page 3-157 for a description of the 'mctb' resource.

See the chapter "Window Manager" in this book for a description of the InitWindows procedure. See Inside Macintosh: Imaging and Inside Macintosh: Text for descriptions of the InitGraf and InitFonts procedures.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996