Name

NSMenuItem — Mac OS X 10.0

Synopsis

This class declares the interface to objects that make up commands in an NSMenu. NSMenuItems have an associated target and action, and may optionally have a key equivalent that the user can use to activate the menu item. Menu items are also capable of maintaining a state (on, off, or mixed).

image with no caption

@interface NSMenuItem : NSObject <NSMenuItem>
                                  // Initializers
   - (id)initWithTitle:(NSString *)aString 
                                 action:(SEL)aSelector 
                                 keyEquivalent:(NSString *)charCode;
                                  // Accessor Methods
   - (void)setAction:(SEL)aSelector;
   - (SEL)action;
   - (void)setRepresentedObject:(id)anObject;
   - (id)representedObject;
   - (void)setSubmenu:(NSMenu *)submenu;
   - (NSMenu *)submenu;
   - (void)setTag:(int)anInt;
   - (int)tag;
   - (void)setTitle:(NSString *)aString;
   - (NSString *)title;
   - (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand;
   - (void)setKeyEquivalent:(NSString *)aKeyEquivalent;
   - (NSString *)keyEquivalent;
   - (void)setTarget:(id)anObject;
   - (id)target;
   - (void)setKeyEquivalentModifierMask:(unsigned int)mask;
   - (unsigned int)keyEquivalentModifierMask;
   - (void)setEnabled:(BOOL)flag;
   - (void)setMixedStateImage:(NSImage *)image;
   - (NSImage *)mixedStateImage;
   - (void)setMnemonicLocation:(unsigned)location;
   - (unsigned)mnemonicLocation;
   - (void)setOffStateImage:(NSImage *)image;
   - (NSImage *)offStateImage;
   - (void)

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.