(Preliminary Documentation) Copyright ã1994 by NeXT Computer, Inc.  All Rights Reserved.

NSMenu 

Inherits From:	NSPanel : NSWindow : NSResponder : NSObject 

Declared In:	appkit/NSMenu.h 

Creating a Menu Zone 

+ (void)setMenuZone:(NSZone *)zone	Sets the zone from which NSMenus should be allocated.
+ (NSZone *)menuZone	Returns the zone from which NSMenus should be allocated, creating one if necessary.

Initializing a New NSMenu 

- (id)initWithTitle:(NSString *)aTitle	Initializes and returns a new NSMenu using aTitle for its title.

Setting Up the Menu Commands 

- (id)addItemWithTitle:(NSString *)aString	Adds a new item with title aString, action aSelector, and   
action:(SEL)aSelector		key equivalent charCode to the end of the NSMenu.  
keyEquivalent:(NSString *)charCode	 	Returns the new NSMenuCell.
- (id)insertItemWithTitle:(NSString *)aString 	Adds a new item at index having the title aString, action 
action:(SEL)aSelector 		aSelector, and key equivalent charCode. Returns the
keyEquivalent:(NSString *)charCode 		 new NSMenuCell.
atIndex:(unsigned int)index
- (void)setItemMatrix:(NSMatrix *)aMatrix	Replaces the current matrix of items with aMatrix.
- (NSMatrix *)itemMatrix	Returns the NSMenu's Matrix of NSMenuCell items.

Finding Menu Items 

- (id)cellWithTag:(int)aTag	Returns the NSMenuCell that has aTag as its tag.

Building Submenus 

- (NSMenuCell *)setSubmenu:(NSMenu *)aMenu	Makes aMenu a submenu controlled by aCell.
forItem:(NSMenuCell *)aCell
- (void)submenuAction:(id)sender	Activates a submenu attached to sender's NSMenu.

Managing NSMenu Windows 

- (NSMenu *)attachedMenu	Returns the NSMenu attached to the receiver or nil if there's no such object.
- (BOOL)isAttached	Returns YES if the receiver is attached to another menu and NO otherwise.
- (BOOL)isTornOff	Returns NO if the receiver is attached to another menu (or if it's the main menu) and YES otherwise.
- (NSPoint)locationForSubmenu:(NSMenu *)aSubmenu
	Determines where to display an attached submenu when it's brought up.
- (void)sizeToFit	Resizes the NSMenu to exactly fit the command items.
- (NSMenu *)supermenu	Returns the receiver's supermenu.

Displaying the Menu 

- (BOOL)autoenablesItems	Returns whether the NSMenu enables and disables its NSMenuCells.  (See the NSMenuActionResponder informal protocol.)
- (void)setAutoenablesItems:(BOOL)flag	Sets whether the NSMenu enables and disables its NSMenuCells.  (See the NSMenuActionResponder informal protocol.)