Important: The information in this document is obsolete and should not be used for new development.
InitMenus
TheInitMenusprocedure allocates space for your application's current menu list in your application's heap. Your application needs to callInitMenusonly once to initialize the Menu Manager and the current menu list for your application.
PROCEDURE InitMenus;DESCRIPTION
TheInitMenusprocedure creates the current menu list with no menus, submenus, or pop-up menus.InitMenusalso creates your application's menu color information table. After allocating the menu color information table,InitMenuslooks 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. IfInitMenusfinds and successfully loads an'mctb'resource, it adds the information contained in that resource to the menu color information table (usingSetMCEntries).The
InitMenusprocedure also draws an empty menu bar.SPECIAL CONSIDERATIONS
Your application must initalize QuickDraw, the Font Manager, and the Window Manager (using theInitGraf,InitFonts, andInitWindowsprocedures) before initializing the Menu Manager.SEE ALSO
To set up the menus for your application's menu bar, useGetNewMBarandSetMenuBar, described on page 3-113 and page 3-114, respectively. You can also add menus to the current menu list using theInsertMenuprocedure, described on page 3-110.To remove all menus from the current menu list, use the
ClearMenuBarprocedure, described on page 3-112.If your application uses its own menu bar definition function, use the
InitProcMenuprocedure to set thembResIDfield 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
InitWindowsprocedure. See Inside Macintosh: Imaging and Inside Macintosh: Text for descriptions of theInitGrafandInitFontsprocedures.