Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Macintosh Toolbox Essentials /
Chapter 3 - Menu Manager / Menu Manager Reference
Menu Manager Routines / Adding Menus to and Removing Menus From the Current Menu List


DeleteMenu

Use the DeleteMenu 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
The DeleteMenu 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, use DisposeMenu if you created the menu using NewMenu; use the Resource Manager procedure ReleaseResource if you created the menu using GetMenu or you read the resource in using GetNewMBar.

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. If DeleteMenu 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 using DisposeMenu, see "Disposing of Menus" on page 3-142. For information on the ReleaseResource procedure, see the chapter "Resource Manager" in Inside
Macintosh: More Macintosh Toolbox
.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996