Important: The information in this document is obsolete and should not be used for new development.
Creating Menus
You can use theNewMenu
orGetMenu
function to create a pull-down menu, although you usually create all the menus in your menu bar at once by providing an'MBAR'
resource and using theGetNewMBar
function. See "Getting and Setting the Menu Bar" on page 3-114 for information on creating a menu bar. You typically use theNewMenu
orGetMenu
function to create submenus or pop-up menus.The
NewMenu
function creates a menu with the specified title, assigns it the specified menu ID, and creates a menu record for the menu. UseAppendMenu
,InsertMenuItem
,AppendResMenu
, orInsertResMenu
to add items to menus you create withNewMenu
.The
GetMenu
function creates a menu with the title, items, and characteristics defined in a specified'MENU'
resource.Both
NewMenu
andGetMenu
allocate space in your application's heap for the menu record and return a handle to the menu's newly created menu record.To add menus created by
NewMenu
orGetMenu
to the current menu list, use theInsertMenu
procedure. To update the menu bar with any new menu titles, useDrawMenuBar
.
Subtopics
- NewMenu
- GetMenu