O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSPopUpButton — Mac OS X 10.0

Synopsis

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.

image with no caption

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required