Up

NSMenuItem

Authors

Ovidiu Predescu (ovidiu@net-community.com)
David Lazaro Saz (khelekir@encomix.es)
The menu cell class.

Copyright: (C) 1996 Free Software Foundation, Inc.


Contents -

  1. Software documentation for the NSMenuItem class
  2. Software documentation for the NSMenuItem(GNUstepExtra) category
  3. Software documentation for the NSMenuItem protocol

Software documentation for the NSMenuItem class

NSMenuItem : NSObject

Declared in:
AppKit/NSMenuItem.h
Conforms to:
NSMenuItem
Standards:

Description forthcoming.


Instance Variables



Instance Variables for NSMenuItem Class

_action

@protected SEL _action;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_changesState

@protected BOOL _changesState;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_enabled

@protected BOOL _enabled;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_image

@protected NSImage* _image;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_keyEquivalent

@protected NSString* _keyEquivalent;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_keyEquivalentModifierMask

@protected unsigned int _keyEquivalentModifierMask;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_menu

@protected NSMenu* _menu;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_mixedStateImage

@protected NSImage* _mixedStateImage;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_mnemonicLocation

@protected unsigned int _mnemonicLocation;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_offStateImage

@protected NSImage* _offStateImage;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_onStateImage

@protected NSImage* _onStateImage;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_representedObject

@protected id _representedObject;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_state

@protected int _state;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_submenu

@protected NSMenu* _submenu;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_tag

@protected int _tag;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_target

@protected id _target;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_title

@protected NSString* _title;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.





Software documentation for the NSMenuItem(GNUstepExtra) category

NSMenuItem(GNUstepExtra)

Declared in:
AppKit/NSMenuItem.h
Standards:

Description forthcoming.

Method summary

changesState 

- (BOOL) changesState;

Description forthcoming.


setChangesState: 

- (void) setChangesState: (BOOL)flag;

Description forthcoming.


Software documentation for the NSMenuItem protocol

NSMenuItem

Declared in:
AppKit/NSMenuItem.h
Conforms to:
NSCopying
NSCoding
NSObject
Standards:

Specifies the methods that an object must implement if it is to be placed in a menu as a menu item. The NSMenuItem class provides a reference implementation suitable for most uses.

Method summary

separatorItem 

+ (id<NSMenuItem>) separatorItem;

Returns a seperator. This is just a blank menu item which serves to divide the menu into seperate parts.


setUsesUserKeyEquivalents: 

+ (void) setUsesUserKeyEquivalents: (BOOL)flag;

Sets a flag that, when set to YES, objects of this class will use user defined key equivalents.


usesUserKeyEquivalents 

+ (BOOL) usesUserKeyEquivalents;

Returns a flag which indicates if the receiver will use user defined key equivalents.


action 

- (SEL) action;

Returns the action of the receiver.


hasSubmenu 

- (BOOL) hasSubmenu;

Returns a boolean indicating if the receiver has a sub menu.


image 

- (NSImage*) image;

Returns the image to be displayed in the receiver.


initWithTitle: action: keyEquivalent: 

- (id) initWithTitle: (NSString*)aString action: (SEL)aSelector keyEquivalent: (NSString*)charCode;

Initializes the receiver with aString as the title. The method called with the menu is selected is represented by aSelector. The key equivalent which can be used to invoke this menu item is represented by charCode.


isEnabled 

- (BOOL) isEnabled;

Returns YES if the receiver is enabled.


isSeparatorItem 

- (BOOL) isSeparatorItem;

Returns a boolean indicating if the receiver is a separator.


keyEquivalent 

- (NSString*) keyEquivalent;

Returns the key equivalent of the receiver.


keyEquivalentModifierMask 

- (unsigned int) keyEquivalentModifierMask;

Returns the key equivalent mask.


menu 

- (NSMenu*) menu;

Returns the menu to which this menu item is connected.


mixedStateImage 

- (NSImage*) mixedStateImage;

Returns the image to be displayed when the receiver is in the "Mixed" state.


mnemonic 

- (NSString*) mnemonic;

Description forthcoming.


mnemonicLocation 

- (unsigned) mnemonicLocation;

Description forthcoming.


offStateImage 

- (NSImage*) offStateImage;

Returns the image to be displayed when the receiver is in the "Off" state.


onStateImage 

- (NSImage*) onStateImage;

Returns the image to be displayed when the receiver is in the "On" state.


representedObject 

- (id) representedObject;

Returns the object represented by the reciever.


setAction: 

- (void) setAction: (SEL)aSelector;

Sets the action as aSelector on the receiver.


setEnabled: 

- (void) setEnabled: (BOOL)flag;

Set the receiver to be enabled.


setImage: 

- (void) setImage: (NSImage*)menuImage;

Sets the image to be displayed in the receiver.


setKeyEquivalent: 

- (void) setKeyEquivalent: (NSString*)aKeyEquivalent;

Sets the key equivalent of the receiver.


setKeyEquivalentModifierMask: 

- (void) setKeyEquivalentModifierMask: (unsigned int)mask;

Sets the modfier for the key equivalent. These masks indicate if the key equivalent requires ALT, Control or other key modifiers.


setMenu: 

- (void) setMenu: (NSMenu*)menu;

Sets the menu which this item belongs to. This method does not retain the object represented by menu.


setMixedStateImage: 

- (void) setMixedStateImage: (NSImage*)image;

Sets the image to be displayed when the receiver is in the "Mixed" state.


setMnemonicLocation: 

- (void) setMnemonicLocation: (unsigned)location;

Description forthcoming.


setOffStateImage: 

- (void) setOffStateImage: (NSImage*)image;

Sets the image to be displayed when the receiver is in the "Off" state.


setOnStateImage: 

- (void) setOnStateImage: (NSImage*)image;

Sets the image to be displayed when the receiver is in the "On" state.


setRepresentedObject: 

- (void) setRepresentedObject: (id)anObject;

Sets the object represented by the reciever to anObject.


setState: 

- (void) setState: (int)state;

Sets the state of the the receiver.


setSubmenu: 

- (void) setSubmenu: (NSMenu*)submenu;

Sets the submenu of the receiver. This method does retain the submenu object.


setTag: 

- (void) setTag: (int)anInt;

Sets the tag of the reciever as anInt.


setTarget: 

- (void) setTarget: (id)anObject;

Sets the target as anObject on the receiver.


setTitle: 

- (void) setTitle: (NSString*)aString;

Sets the title of the menu, represented by aString.


setTitleWithMnemonic: 

- (void) setTitleWithMnemonic: (NSString*)stringWithAmpersand;

Description forthcoming.


state 

- (int) state;

Returns the state of the receiver.


submenu 

- (NSMenu*) submenu;

Returns the attached submenu.


tag 

- (int) tag;

Returns the tag of the receiver.


target 

- (id) target;

Returns the target of the receiver.


title 

- (NSString*) title;

Returns the menu's title.


userKeyEquivalent 

- (NSString*) userKeyEquivalent;

Returns the key equivalent defined by the users defaults.


userKeyEquivalentModifierMask 

- (unsigned int) userKeyEquivalentModifierMask;

Returns the user defined key equivalent modifier.



Up