![]() |
API 0.9.5
|
#import <CPMenu.h>
Menus provide the user with a list of actions and/or submenus. Submenus themselves are full fledged menus and so a hierarchical structure appears.
- (void) addItem: | (CPMenuItem) | aMenuItem |
- (CPMenuItem) addItemWithTitle: | (CPString) | aTitle | |
action: | (SEL) | anAction | |
keyEquivalent: | (CPString) | aKeyEquivalent | |
Creates and adds a menu item with the specified attributes at the end of the menu.
aTitle | the title of the new menu item |
anAction | the action initiated when the user selects the item |
aKeyEquivalent | the keyboard shortcut for the menu item |
- (BOOL) autoenablesItems |
- (void) encodeWithCoder: | (CPCoder) | aCoder |
- (CPMenuItem) highlightedItem |
- (int) indexOfItem: | (CPMenuItem) | aMenuItem |
- (int) indexOfItemWithRepresentedObject: | (id) | anObject |
- (int) indexOfItemWithSubmenu: | (CPMenu) | aMenu |
- (int) indexOfItemWithTag: | (int) | aTag |
- (int) indexOfItemWithTarget: | (id) | aTarget | |
andAction: | (SEL) | anAction | |
- (int) indexOfItemWithTitle: | (CPString) | aTitle |
- (id) initWithCoder: | (CPCoder) | aCoder |
- (id) initWithTitle: | (CPString) | aTitle |
- (void) insertItem: | (CPMenuItem) | aMenuItem | |
atIndex: | (unsigned) | anIndex | |
- (CPMenuItem) insertItemWithTitle: | (CPString) | aTitle | |
action: | (SEL) | anAction | |
keyEquivalent: | (CPString) | aKeyEquivalent | |
atIndex: | (unsigned) | anIndex | |
Creates and inserts a new menu item with the specified attributes.
aTitle | the title of the menu item |
anAction | the action initiated when the user selects the item |
aKeyEquivalent | the keyboard shortcut for the item |
anIndex | the index location in the menu for the new item |
- (void) insertObject: | (CPMenuItem) | aMenuItem | |
inItemsAtIndex: | (CPUInteger) | anIndex | |
- (BOOL) isTornOff |
- (CPArray) itemArray |
- (CPMenuItem) itemAtIndex: | (int) | anIndex |
- (void) itemChanged: | (CPMenuItem) | aMenuItem |
- (CPArray) itemsAtIndexes: | (CPIndexSet) | indexes |
- (CPMenuItem) itemWithTag: | (int) | aTag |
- (CPMenuItem) itemWithTitle: | (CPString) | aTitle |
+ (CPDictionary) menuBarAttributes |
- (unsigned) numberOfItems |
- (CPMenuItem) objectInItemsAtIndex: | (CPUInteger) | anIndex |
- (void) performActionForItemAtIndex: | (unsigned) | anIndex |
- (BOOL) performKeyEquivalent: | (CPEvent) | anEvent |
- (void) popUpMenuPositioningItem: | (CPMenuItem) | anItem | |
atLocation: | (CGPoint) | aLocation | |
inView: | (CPView) | aView | |
callback: | (Function) | aCallback | |
- (void) removeAllItems |
- (void) removeItem: | (CPMenuItem) | aMenuItem |
- (void) removeItemAtIndex: | (unsigned) | anIndex |
- (void) removeObjectFromItemsAtIndex: | (CPUInteger) | anIndex |
- (void) setAutoenablesItems: | (BOOL) | aFlag |
+ (void) setMenuBarAttributes: | (CPDictionary) | attributes |
- (void) setShowsStateColumn: | (BOOL) | shouldShowStateColumn |
- (void) setSubmenu: | (CPMenu) | aMenu | |
forItem: | (CPMenuItem) | aMenuItem | |
- (void) setSupermenu: | (CPMenu) | aMenu |
- (void) setTitle: | (CPString) | aTitle |
- (BOOL) showsStateColumn |
- (void) submenuAction: | (id) | aSender |
- (CPMenu) supermenu |
+ (Function) trackingCallbackWithCallback: | (Function) | aCallback |
- (void) update |
Enables or disables the receiver’s menu items. If the target does not implement the menu item's action method the item is disabled. If the target responsds to selector validateMenuItem: or validateUserInterfaceItem: (in that order) the return value is used.