Important: The information in this document is obsolete and should not be used for new development.
DeleteMenu
Use theDeleteMenuprocedure 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,
DeleteMenudoes nothing.DESCRIPTION
TheDeleteMenuprocedure 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.DeleteMenudoes not release the memory occupied by the menu's menu record. To release the memory occupied by the menu's associated data structures, useDisposeMenuif you created the menu usingNewMenu; use the Resource Manager procedureReleaseResourceif you created the menu usingGetMenuor you read the resource in usingGetNewMBar.The
DeleteMenuprocedure 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. IfDeleteMenudoesn'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
DrawMenuBarto 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 theReleaseResourceprocedure, see the chapter "Resource Manager" in Inside
Macintosh: More Macintosh Toolbox.