NSPopUpButton

NSPopUpButton Mac OS X 10.0

This class implements a pop-up button interface component. A pop-up button is a button that displays a menu when it is activated; the displayed menu can either be a pop-up menu that appears beneath the mouse cursor, or a pull-down menu that is drawn below the button.

figs/cocn_1569.gif

@interface NSPopUpButton : NSButton
 // Initializers
   - (id)initWithFrame:(NSRect)buttonFrame pullsDown:(BOOL)flag;
 // Accessor Methods
   - (void)setPullsDown:(BOOL)flag;
   - (BOOL)pullsDown;
   - (void)setTitle:(NSString *)aString;
   - (void)setAutoenablesItems:(BOOL)flag;
   - (BOOL)autoenablesItems;
   - (void)setPreferredEdge:(NSRectEdge)edge;
   - (NSRectEdge)preferredEdge;
   - (void)setMenu:(NSMenu *)menu;
   - (NSMenu *)menu;
 // Instance Methods
   - (void)addItemWithTitle:(NSString *)title;
   - (void)addItemsWithTitles:(NSArray *)itemTitles;
   - (int)indexOfItem:(id <NSMenuItem>)item;
   - (int)indexOfItemWithRepresentedObject:(id)obj;
   - (int)indexOfItemWithTag:(int)tag;
   - (int)indexOfItemWithTarget:(id)target andAction:(SEL)actionSelector;
   - (int)indexOfItemWithTitle:(NSString *)title;
   - (int)indexOfSelectedItem;
   - (void)insertItemWithTitle:(NSString *)title atIndex:(int)index;
   - (NSArray *)itemArray;
   - (id <NSMenuItem>)itemAtIndex:(int)index;
   - (NSString *)itemTitleAtIndex:(int)index;
   - (NSArray *)itemTitles;
   - (id <NSMenuItem>)itemWithTitle:(NSString *)title;
   - (id <NSMenuItem>)lastItem;
   - (int)numberOfItems;
   - (void)removeAllItems;
   - (void)removeItemAtIndex:(int)index;
   - (void)removeItemWithTitle:(NSString *)title;
   - (void)selectItem:(id <NSMenuItem>)item;
   - (void)selectItemAtIndex:(int)index;
   - (void)selectItemWithTitle:(NSString *)title;
   - (id <NSMenuItem>)selectedItem;
   - (void)synchronizeTitleAndSelectedItem;
   - (NSString *)titleOfSelectedItem;
// Notifications
   NSPopUpButtonWillPopUpNotification;



    Part II: API Quick Reference
    Chapter 13. Foundation Classes