ftp.nice.ch/peanuts/GeneralData/Documents/openstep/OpenStepSpec_rtf.tar.gz#/OpenStepSpec_rtf/ApplicationKit/Classes/NSPopUpButton.rtf

This is NSPopUpButton.rtf in view mode; [Download] [Up]

paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc.  All Rights Reserved.

s4 li100 fi0 ri1007 ql f0 b fs36 fs100 
fs36 NSPopUpButton 
pard s11 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 
fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSButton : NSControl : NSView : NSResponder : NSObject
fs20 
fs28 s6 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCoding (NSResponder)
fi0 NSObject (NSObject)
fs20 
fs28 s7 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 AppKit/NSPopUpButton.h 
fs20 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs28 fs20 
fs28 Class Description
fs14 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 
fs28 The NSPopUpButton class defines objects that implement the pop-up and pull-down lists of the OpenStep graphical user interface. When configured to display a pop-up list, an NSPopUpButton contains a number of options and displays as its title the option that was last selected. A pop-up list is often used for selecting items from a small- to medium-sized set of options (like the zoom factor for a document window). It'27s a useful alternative to a matrix of radio buttons or an NSBrowser when screen space is at a premium; a zoom factor pop-up can easily fit next to a scroll bar at the bottom of a window, for example. 
fs16 
fs28 When configured to display a pull-down list, an NSPopUpButton is generally used for selecting commands in a very specific context. You can think of a pull-down list as a compact form of menu. A pull-down list'27s title isn'27t affected by the user'27s actions, and a pull-down list always displays a title that identifies the type of commands it contains. When the commands only make sense in the context of a particular display, a pull-down list can be used in that display to keep the related actions nearby, and to keep them out of the way when that display isn'27t visible. 
fs16 
fs28 pard s16 li100 fi0 ri1007 ql f0 b fs24 
fs28 Initializing an NSPopUpButton 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (id)b initWithFrame:b0 (NSRect)i frameRecti0 tab Initializes a newly allocated NSPopUpButton, giving it the 
s9 li7030 fi-6553 fi-5796 b pullsDown:b0 (BOOL)i flagtab tab i0 frame specified by i frameRect.i0  If i flagi0  is YES, the receiver is initialized to operate as a pull-down list; otherwise, it operates as a pop-up list.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Target and Action 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (SEL)b actionb0 tab Returns the NSPopUpButton'27s action method.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setAction:b0 (SEL)i aSelectori0 tab Sets the NSPopUpButton'27s action method to i aSelectori0 .
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Adding Items 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (void)b addItemWithTitle:b0 (NSString *)i titlei0 tab Adds an item with i titlei0  as its title to the end of the item list.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b addItemsWithTitles:b0 (NSArray *)i itemTitlesi0 tab Adds multiple items to the end of the item list. The titles for the new items are taken from the i itemTitles i0 arrayi .
fi-6552 i0 fs16 
fs28 fi-6552 {f3 -} (void)b insertItemWithTitle:b0 (NSString *)i titlei0 tab Inserts an item with i titlei0  as its title at position i indexi0 . 
s9 li7030 fi-6553 fi-5796 b atIndex:b0 (unsigned int)i index
pard s16 li100 fi0 ri1007 ql f0 b i0 fs48 
fs28 Removing Items 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (void)b removeAllItemsb0 tab Removes all items in the receiver'27s item list. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b removeItemWithTitle:b0 (NSString *)i titlei0 tab Removes the item whose title matches i title.i0  
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b removeItemAtIndex:b0 (int)i indexi0 tab Removes the item at the specified index.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Querying the NSPopUpButton about Its Items 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (int)b indexOfItemWithTitle:b0 (NSString *)i titlei0 tab Returns the index of the item whose title matches i titlei0 , or {f3 -}1 if no match is found.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b indexOfSelectedItemb0 tab Returns the index of the item last selected by the user, or {f3 -}1 if there'27s no selected item.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b numberOfItemsb0 tab Returns the number of items in the receiver'27s item list. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSMenuCell *)b itemAtIndex:b0 (int)i indexi0 tab Returns the NSMenuCell for the item at i indexi0 , or b nilb0  if no such item exists.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSMatrix *)b itemMatrixb0 tab Returns the NSMatrix that holds the receiver'27s items.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSString *)b itemTitleAtIndex:b0 (int)i indexi0 tab Returns the title of the item at i indexi0 , or the empty string if no such item exists.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSArray *)b itemTitlesb0 tab Returns an NSArray that holds the titles of the receiver'27s items.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSMenuCell *)b itemWithTitle:b0 (NSString *)i titlei0 tab Returns the NSMenuCell for the item whose title is i titlei0 , or b nilb0  if no such item exists
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSMenuCell *)b lastItemb0 tab Returns the NSMenuCell corresponding to the last item in the list.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSMenuCell *)b selectedItemb0 tab Returns the NSMenuCell for the selected item.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSString *)b titleOfSelectedItemb0 tab Returns the title of the item last selected by the user, or the empty string if there'27s no such item.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Manipulating the NSPopUpButton
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSFont *)b fontb0 tab Returns the font used to draw the items. 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b pullsDownb0 tab Returns YES if the receiver is configured as a pull-down list, and NO if it'27s configured as a pop-up list.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b selectItemAtIndex:b0 (int)i indexi0 tab Selects the item at i indexi0  and invokes b synchronizeTitleAndSelectedItemb0 .
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b selectItemWithTitle:b0 (NSString *)i titlei0 tab Selects the item whose title is i titlei0  and invokes b synchronizeTitleAndSelectedItemb0 .
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setFont:b0 (NSFont *)i fontObjecti0 tab Sets the font used to draw the items.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setPullsDown:b0 (BOOL)i flagi0 tab If i flagi0  is YES, the receiver is configured as a pull-down list. If i flagi0  is NO, the receiver is configured as a pop-up list.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setTarget:b0 (id)i anObjecti0 tab Sets the target for action messages to i anObjecti0 .
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setTitle:b0 (NSString *)i aStringi0 tab Adds a new item (if the receiver doesn'27t already have an item titled i aStringi0 ), makes it the selected item, and invokes b synchronizeTitleAndSelectedItemb0 . 
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSString *)b stringValueb0 tab Returns the title of the selected item.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b synchronizeTitleAndSelectedItemb0 tab Ensures that the receiver'27s title agrees with the title of the selected item (see b indexOfSelectedItemb0 ). If there'27s no selected item, this method selects the first item in the item list and sets the receiver'27s title to match. This method is useful in subclasses that directly select items in the item matrix or that override b setTitle:b0 .
fi-6552 fs16 
fs28 fi-6552 {f3 -} (id)b targetb0 tab Returns the target for action messages.
pard s16 li100 fi0 ri1007 ql f0 b fs48 
fs28 Displaying the NSPopUpButton'27s Items 
fs14 
fs28 pard s8 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (BOOL)b autoenablesItemsb0 tab Returns whether the NSPopUpButton enables and disables its items. (See the NSMenuActionResponder informal protocol.)
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setAutoenablesItems:b0 (BOOL)i flagi0 tab Sets whether the NSPopUpButton enables and disables its items. (See the NSMenuActionResponder informal protocol.)
s9 li7030 fi-6553 fi-5796 
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.