DekGenius.com
[ Team LiB ] Previous Section Next Section

NSMenuItem Mac OS X 10.0

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).

figs/cocn_1549.gif

@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)setImage:(NSImage *)menuImage;
   - (NSImage *)image;
   - (void)setState:(int)state;
   - (int)state;
   - (void)setMenu:(NSMenu *)menu;
   - (NSMenu *)menu;
   - (void)setOnStateImage:(NSImage *)image;
   - (NSImage *)onStateImage;
 // Class Methods
   + (id <NSMenuItem>)separatorItem;
   + (void)setUsesUserKeyEquivalents:(BOOL)flag;
   + (BOOL)usesUserKeyEquivalents;
 // Instance Methods
   - (BOOL)hasSubmenu;
   - (BOOL)isEnabled;
   - (BOOL)isSeparatorItem;
   - (NSString *)mnemonic;
   - (NSString *)userKeyEquivalent;
 // Methods Implementing NSMenuItem
   - (id)initWithTitle:(NSString *)aString action:(SEL)aSelector keyEquivalent:(NSString *)charCode;
   - (void)setMenu:(NSMenu *)menu;
   - (NSMenu *)menu;
   - (BOOL)hasSubmenu;
   - (void)setSubmenu:(NSMenu *)submenu;
   - (NSMenu *)submenu;
   - (void)setTitle:(NSString *)aString;
   - (NSString *)title;
   - (BOOL)isSeparatorItem;
   - (void)setKeyEquivalent:(NSString *)aKeyEquivalent;
   - (NSString *)keyEquivalent;
   - (void)setKeyEquivalentModifierMask:(unsigned int)mask;
   - (unsigned int)keyEquivalentModifierMask;
   - (NSString *)userKeyEquivalent;
   - (unsigned int)userKeyEquivalentModifierMask;
   - (void)setMnemonicLocation:(unsigned)location;
   - (unsigned)mnemonicLocation;
   - (NSString *)mnemonic;
   - (void)setTitleWithMnemonic:(NSString *)stringWithAmpersand;
   - (void)setImage:(NSImage *)menuImage;
   - (NSImage *)image;
   - (void)setState:(int)state;
   - (int)state;
   - (void)setOnStateImage:(NSImage *)image;
   - (NSImage *)onStateImage;
   - (void)setOffStateImage:(NSImage *)image;
   - (NSImage *)offStateImage;
   - (void)setMixedStateImage:(NSImage *)image;
   - (NSImage *)mixedStateImage;
   - (void)setEnabled:(BOOL)flag;
   - (BOOL)isEnabled;
   - (void)setTarget:(id)anObject;
   - (id)target;
   - (void)setAction:(SEL)aSelector;
   - (SEL)action;
   - (void)setTag:(int)anInt;
   - (int)tag;
   - (void)setRepresentedObject:(id)anObject;
   - (id)representedObject;

    [ Team LiB ] Previous Section Next Section