Return to the Alphabetic Index
Return to the Class Browser
Return to the Picture Browser
Copyright (c) 1994 by NeXT Computer, Inc. All Rights Reserved.

NSMenu

Inherits From: NSPanel : NSWindow : NSResponder : NSObject

Conforms To: NSCoding (NSResponder) NSObject (NSObject)

Declared In: AppKit/NSMenu.h

Class Description

This class defines an object that manages an application's menus. An NSMenu object displays a list of items that a user can choose from. When an item is clicked, it may either issue a command directly or bring up another menu (a submenu) that offers further choices. An NSMenu object's choices are implemented as a column of NSMenuCells in an NSMatrix.

Each NSMenuCell can be configured to send its action message to a target, or to bring up a submenu. When the user clicks a submenu item, the submenu is displayed on the screen, attached to its supermenu so that if the user drags the supermenu, the submenu follows it. A submenu may also be torn away from its supermenu, in which case it displays a close button.

Exactly one NSMenu created by the application is designated as the main menu for the application (with NSApplication's setMainMenu: method). This menu is displayed on top of all other windows whenever the application is active, and should never display a close button (because the main menu doesn't have a supermenu).

See the NSMenuCell and NSMatrix class specificiations for more details.

Controlling Allocation Zones

Initializing a New NSMenu

Setting Up the Menu Commands

Finding Menu Items

Building Submenus

Managing NSMenu Windows

Displaying the Menu