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

This is NSButtonCell.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 NSButtonCell
pard s14 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 
fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSActionCell : NSCell : NSObject
fs20 
fs28 s7 f0 b fs24 Conforms To:tab b0 fs28 f1 NSCoding, NSCopying (NSCell)
fi0 NSObject (NSObject)
fs20 
fs28 s8 fi-2771 f0 b fs24 Declared In:tab b0 fs28 f1 AppKit/NSButtonCell.h 
fs20 
fs28 pard s19 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 NSButtonCell is a subclass of NSActionCell used to implement the user interfaces of push buttons, switches, and radio buttons. It can also be used for any other region of a view that'27s designed to send a message to a target when clicked. The NSButton subclass of NSControl uses a single NSButtonCell. To create groups of switches or radio buttons, use an NSMatrix holding a set of NSButtonCells.
fs16 
fs28 An NSButtonCell is a two-state cell; it'27s either 'aaoff'ba or 'aaon,'ba and can be configured to display the two states differently, with a separate title and/or image for either state. The two states are more often referred to as 'aanormal'ba and 'aaalternate.'ba An NSButtonCell'27s state is also used as its value, so NSCell methods that set the value (b setIntValue:b0  and so on) actually set the NSButtonCell'27s state to 'aaon'ba if the value provided is non-zero (or non-null for strings), and to 'aaoff'ba if the value is zero or null. Similarly, methods that retrieve the value return 1 for the 'aaon'ba or alternate state (an empty string in the case of b stringValueb0 ), or 0 or NULL for the 'aaoff'ba or normal state. You can also use NSCell'27s b setState:b0  and b stateb0  methods to set or retrieve the state directly. After changing the state, send a b display b0 message to show the NSButtonCell'27s new appearance. (NSButton does this automatically.)
fs16 
fs28 An NSButtonCell sends its action message to its target once if its view is clicked and it gets the mouse-down event, but can also send the action message continuously as long as the mouse is held down with the cursor inside the NSButtonCell. The NSButtonCell can show that it'27s being pressed by highlighting in several ways'd0for example, a bordered NSButtonCell can appear pushed into the screen, or the image or title can change to an alternate form while the NSButtonCell is pressed.
fs16 
fs28 An NSButtonCell can also have a key equivalent (like a menu item). If the NSButtonCell is displayed in the key window, the NSButtonCell gets the first chance to receive events related to key equivalents. This feature is used quite often in modal panels that have an 'aaOK'ba button containing the image that represents the Return key. Usually an NSButtonCell displays a key equivalent as its image; if you ever set an image for the NSButtonCell, the key equivalent remains, but doesn'27t get displayed.
fs16 
fs28 For more information on NSButtonCell'27s behavior, see the NSButton and NSMatrix class specifications. 
fs16 
fs28 pard s19 li100 fi0 ri1007 ql f0 b fs24 
fs28 Exceptions
fs14 
fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 In its implementation of the b compare:b0  method (declared in NSCell), NSButtonCell raises NSBadComparisonException if the i otherCelli0  argument is not of the NSButtonCell class.
fs6 
fs28 s19 li100 fi376 fi0 f0 b fs36 
fs28 Setting the Titles 
fs14 
fs28 pard s9 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSString *)b alternateTitleb0 tab Returns the NSButtonCell'27s alternate title (used while the button is in the highlighted state).
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setAlternateTitle:b0 (NSString *)i aStringi0 tab Makes a copy of i aStringi0  and uses it as the NSButtonCell'27s alternate title.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setFont:b0 (NSFont *)i fontObjecti0 tab Sets the NSFont used to draw the title.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setTitle:b0 (NSString *)i aStringi0 tab Makes a copy of i aStringi0  and uses it as the NSButtonCell'27s title.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSString *)b titleb0 tab Returns the NSButtonCell'27s title.
pard s19 li100 fi0 ri1007 ql f0 b fs48 
fs28 Setting the Images 
fs14 
fs28 pard s9 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSImage *)b alternateImageb0 tab Returns the NSButtonCell'27s alternate image (used while the button is in the highlighted state).
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSCellImagePosition)b imagePositionb0 tab Returns the position of the NSButtonCell'27s image.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setAlternateImage:b0 (NSImage *)i anImagei0 tab Makes i anImagei0  the alternate image.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setImagePosition:b0 (NSCellImagePosition)i aPosition
s11 li7030 fi-6553 fi-5796 i0 tab Sets the position of the NSButtonCell'27s image in relation to its title.
pard s19 li100 fi0 ri1007 ql f0 b fs48 
fs28 Setting the Repeat Interval 
fs14 
fs28 pard s9 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (void)b getPeriodicDelay:b0 (float *)i delayi0 tab Gets repeat parameters for continuous NSButtonCells.tab  
s11 li7030 fi-6553 fi-5796 b interval:b0 (float *)i interval
s9 li7029 fi-5794 fi-6552 i0 fs16 
fs28 fi-6552 {f3 -} (void)b setPeriodicDelay:b0 (float)i delayi0 tab Sets repeat parameters for continuous NSButtonCells.tab  
s11 li7030 fi-6553 fi-5796 b interval:b0 (float)i interval
pard s19 li100 fi0 ri1007 ql f0 b i0 fs48 
fs28 Setting the Key Equivalent 
fs14 
fs28 pard s9 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (NSString *)b keyEquivalentb0 tab Returns the NSButtonCell'27s key equivalent.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (NSFont *)b keyEquivalentFontb0 tab Returns the NSFont used to draw the key equivalent.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (unsigned int)b keyEquivalentModifierMasktab b0 Returns the mask indicating the possible modifier keys for NSButtonCell'27s key equivalent.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setKeyEquivalent:b0 (NSString *)i aKeyEquivalenti0 tab 
s11 li7030 fi-6553 fi-5796 tab Sets the NSButtonCell'27s key equivalent.
s9 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setKeyEquivalentModifierMask:b0 (unsigned int)i maski0 tab 
s11 li7030 fi-6553 fi-5796 tab Sets the mask that determines the possible modifier keys for NSButtonCell'27s key equivalent.
s9 li7029 fi-5794 fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setKeyEquivalentFont:b0 (NSFont *)i fontObji0 tab Sets the NSFont used to draw the key equivalent.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setKeyEquivalentFont:b0 (NSString *)i fontNamei0 tab  
s11 li7030 fi-6553 fi-5796 b size:b0 (float)i fontSizei0 tab Sets the NSFont and size used to draw the key equivalent.
pard s19 li100 fi0 ri1007 ql f0 b fs48 
fs28 Modifying Graphic Attributes 
fs14 
fs28 pard s9 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (BOOL)b isOpaqueb0 tab Returns whether receiver is opaque.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (BOOL)b isTransparentb0 tab Returns whether the NSButtonCell is transparent.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setTransparent:b0 (BOOL)i flagi0 tab Sets whether the NSButtonCell is transparent.
pard s19 li100 fi0 ri1007 ql f0 b fs48 
fs28 Modifying Graphic Attributes 
fs14 
fs28 pard s9 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (int)b highlightsByb0 tab Returns how the NSButtonCell highlights when pressed.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setHighlightsBy:b0 (int)i aTypei0 tab Sets how the NSButtonCell highlights when pressed.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setShowsStateBy:b0 (int)i aTypei0 tab Sets how the NSButtonCell shows its alternate (pressed) state.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (void)b setType:b0 (NSButtonType)i aTypei0 tab Sets the NSButtonCell'27s display behavior.
fi-6552 fs16 
fs28 fi-6552 {f3 -} (int)b showsStateByb0 tab Returns how NSButtonCell shows its alternate (pressed) state.
pard s19 li100 fi0 ri1007 ql f0 b fs48 
fs28 Simulating a Click 
fs14 
fs28 pard s9 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 
fs28 fi-6552 {f3 -} (void)b performClick:b0 (id)i senderi0 tab Simulates a user'27s mouse click on the NSButtonCell.
}

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