Important: The information in this document is obsolete and should not be used for new development.
InitMenus
TheInitMenus
procedure allocates space for your application's current menu list in your application's heap. Your application needs to callInitMenus
only once to initialize the Menu Manager and the current menu list for your application.
PROCEDURE InitMenus;DESCRIPTION
TheInitMenus
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. IfInitMenus
finds and successfully loads an'mctb'
resource, it adds the information contained in that resource to the menu color information table (usingSetMCEntries
).The
InitMenus
procedure also draws an empty menu bar.SPECIAL CONSIDERATIONS
Your application must initalize QuickDraw, the Font Manager, and the Window Manager (using theInitGraf
,InitFonts
, andInitWindows
procedures) before initializing the Menu Manager.SEE ALSO
To set up the menus for your application's menu bar, useGetNewMBar
andSetMenuBar
, described on page 3-113 and page 3-114, respectively. You can also add menus to the current menu list using theInsertMenu
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 thembResID
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 theInitGraf
andInitFonts
procedures.