Important: The information in this document is obsolete and should not be used for new development.
DeleteMenu
Use theDeleteMenu
procedure to delete an existing menu from the current menu list.
PROCEDURE DeleteMenu (menuID: Integer);
menuID
- The menu ID of the menu to delete from the current menu list. If the menu list does not contain a menu with the specified menu ID,
DeleteMenu
does nothing.DESCRIPTION
TheDeleteMenu
procedure deletes the menu identified by the specified menu ID
from the current menu list, and it removes all color entries for that menu from the application's menu color information table.DeleteMenu
does not release the memory occupied by the menu's menu record. To release the memory occupied by the menu's associated data structures, useDisposeMenu
if you created the menu usingNewMenu
; use the Resource Manager procedureReleaseResource
if you created the menu usingGetMenu
or you read the resource in usingGetNewMBar
.The
DeleteMenu
procedure first checks the submenu portion of the current menu list for a menu ID with the specified ID. If it finds such a menu, it deletes that menu and returns. IfDeleteMenu
doesn't find the menu in the submenu portion, it checks the regular portion of the current menu list. This allows a desk accessory to delete a submenu without deleting an application's menu whose menu ID might conflict with the menu ID defined by a desk accessory.After deleting a menu, use
DrawMenuBar
to update the menu bar to reflect the changes to the current menu list.SEE ALSO
For details on how to dispose of a menu's associated data structures usingDisposeMenu
, see "Disposing of Menus" on page 3-142. For information on theReleaseResource
procedure, see the chapter "Resource Manager" in Inside
Macintosh: More Macintosh Toolbox.