Up

# NSButtonCell

### Authors

Scott Christley (`scottc@net-community.com`)
Felipe A. Rodriguez (`far@ix.netcom.com`)

> The button cell class

Copyright: (C) 1996-1999 Free Software Foundation, Inc.

# Software documentation for the NSButtonCell class

## NSButtonCell : NSActionCell

> Declared in:
>   AppKit/NSButtonCell.h

Availability: OpenStep

TODO Description

Instance Variables
Method summary

- -alternateImage
- -alternateMnemonic
- -alternateMnemonicLocation
- -alternateTitle
- -attributedAlternateTitle
- -attributedTitle
- -backgroundColor
- -bezelStyle
- -drawBezelWithFrame:inView:
- -drawImage:withFrame:inView:
- -drawTitle:withFrame:inView:
- -getPeriodicDelay:interval:
- -gradientType
- -highlightsBy
- -imageDimsWhenDisabled
- -imagePosition
- -imageScaling
- -isTransparent
- -keyEquivalent
- -keyEquivalentFont
- -keyEquivalentModifierMask
- -mouseEntered:
- -mouseExited:
- -setAlternateImage:
- -setAlternateMnemonicLocation:
- -setAlternateTitle:
- -setAlternateTitleWithMnemonic:
- -setAttributedAlternateTitle:
- -setAttributedTitle:
- -setBackgroundColor:
- -setBezelStyle:
- -setButtonType:
- -setFont:
- -setGradientType:
- -setHighlightsBy:
- -setImageDimsWhenDisabled:
- -setImagePosition:
- -setImageScaling:
- -setKeyEquivalent:
- -setKeyEquivalentFont:
- -setKeyEquivalentFont:size:
- -setKeyEquivalentModifierMask:
- -setPeriodicDelay:interval:
- -setShowsBorderOnlyWhileMouseInside:
- -setShowsStateBy:
- -setSound:
- -setTitle:
- -setTitleWithMnemonic:
- -setTransparent:
- -showsBorderOnlyWhileMouseInside
- -showsStateBy
- -sound
- -title

### alternateImage

- (NSImage*) alternateImage;
Availability: OpenStep

Returns the NSButtonCell's alternate image.

See Also: -setAlternateImage:

### alternateMnemonic

- (NSString*) alternateMnemonic;
Availability: MacOS-X 10.0.0
Description forthcoming.

### alternateMnemonicLocation

- (NSUInteger) alternateMnemonicLocation;
Availability: MacOS-X 10.0.0
Description forthcoming.

### alternateTitle

- (NSString*) alternateTitle;
Availability: OpenStep

Returns the NSButtonCell's alternate title (used when highlighted).

See Also: -setAlternateTitle:

### attributedAlternateTitle

- (NSAttributedString*) attributedAlternateTitle;
Availability: MacOS-X 10.0.0
Description forthcoming.

### attributedTitle

- (NSAttributedString*) attributedTitle;
Availability: MacOS-X 10.0.0
Description forthcoming.

### backgroundColor

- (NSColor*) backgroundColor;
Availability: MacOS-X 10.4.0
Description forthcoming.

### bezelStyle

- (NSBezelStyle) bezelStyle;
Availability: MacOS-X 10.0.0
Description forthcoming.

### drawBezelWithFrame: inView:

- (void) drawBezelWithFrame: (NSRect)cellFrame inView: (NSView*)controlView;
Availability: MacOS-X 10.4.0
Description forthcoming.

### drawImage: withFrame: inView:

- (void) drawImage: (NSImage*)imageToDisplay withFrame: (NSRect)cellFrame inView: (NSView*)controlView;
Availability: MacOS-X 10.4.0
Description forthcoming.

### drawTitle: withFrame: inView:

- (NSRect) drawTitle: (NSAttributedString*)titleToDisplay withFrame: (NSRect)cellFrame inView: (NSView*)controlView;
Availability: MacOS-X 10.4.0
Description forthcoming.

### getPeriodicDelay: interval:

- (void) getPeriodicDelay: (float*)delay interval: (float*)interval;
Availability: OpenStep

Gets the NSButtonCell's delay and the interval parameters used when NSButton sends continouly action messages. By default delay is 0.4 and interval is 0.075.

See Also: -setPeriodicDelay:interval: [NSCell -trackMouse:inRect:ofView:untilMouseUp:]

### gradientType

- (NSGradientType) gradientType;
Availability: MacOS-X 10.0.0
Description forthcoming.

### highlightsBy

- (NSInteger) highlightsBy;
Availability: OpenStep

Returns a mask describing how the button cell is highlighted :

NSNoCellMask, NSContentsCellMask,NSPushInCellMask,NSChangeGrayCellMask, NSChangeBackgroundCellMask

See Also : -setHighlightsBy:

### imageDimsWhenDisabled

- (BOOL) imageDimsWhenDisabled;
Availability: MacOS-X 10.0.0
Description forthcoming.

### imagePosition

- (NSCellImagePosition) imagePosition;
Availability: OpenStep

Returns the NSButtonCell's image position. See NSCellImagePosition for more information.

See Also: -setImagePosition:

### imageScaling

- (NSImageScaling) imageScaling;
Availability: MacOS-X 10.5.0
Description forthcoming.

### isTransparent

- (BOOL) isTransparent;
Availability: OpenStep

Returns whether the button cell is transparent.

See Also: -setTransparent:

### keyEquivalent

- (NSString*) keyEquivalent;
Availability: OpenStep

Returns the NSButtonCell's key equivalent. The key equivalent and its modifier mask are used to simulate the click of the button in [NSButton -performKeyEquivalent:] . Returns an empty string if no key equivalent is defined. By default NSButtonCell hasn't key equivalent.

See Also: -setKeyEquivalent: [NSButton -performKeyEquivalent:] -keyEquivalentModifierMask [NSButtonCell -keyEquivalent]

### keyEquivalentFont

- (NSFont*) keyEquivalentFont;
Availability: OpenStep

Returns the NSFont of the key equivalent.

See Also: -setKeyEquivalentFont:

### keyEquivalentModifierMask

- (NSUInteger) keyEquivalentModifierMask;
Availability: OpenStep

Returns the modifier mask of the NSButtonCell's key equivalent. The key equivalent and its modifier mask are used to simulate the click of the button in [NSButton -performKeyEquivalent:] . The default mask is 0.

See Also: -setKeyEquivalentModifierMask: -keyEquivalent [NSButton -performKeyEquivalent:]

### mouseEntered:

- (void) mouseEntered: (NSEvent*)event;
Availability: MacOS-X 10.0.0
Description forthcoming.

### mouseExited:

- (void) mouseExited: (NSEvent*)event;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setAlternateImage:

- (void) setAlternateImage: (NSImage*)anImage;
Availability: OpenStep

Sets the NSButtonCell's alternate image to anImage.

See Also: -alternateImage

### setAlternateMnemonicLocation:

- (void) setAlternateMnemonicLocation: (NSUInteger)location;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setAlternateTitle:

- (void) setAlternateTitle: (NSString*)aString;
Availability: OpenStep

Sets the NSButtonCell's alternate title (used when highlighted) to aString and update the cell if it contains a NSControl view.

See Also: -alternateTitle

### setAlternateTitleWithMnemonic:

- (void) setAlternateTitleWithMnemonic: (NSString*)aString;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setAttributedAlternateTitle:

- (void) setAttributedAlternateTitle: (NSAttributedString*)aString;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setAttributedTitle:

- (void) setAttributedTitle: (NSAttributedString*)aString;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setBackgroundColor:

- (void) setBackgroundColor: (NSColor*)color;
Availability: MacOS-X 10.4.0
Description forthcoming.

### setBezelStyle:

- (void) setBezelStyle: (NSBezelStyle)bezelStyle;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setButtonType:

- (void) setButtonType: (NSButtonType)buttonType;
Availability: OpenStep
Description forthcoming.

### setFont:

- (void) setFont: (NSFont*)fontObject;
Availability: OpenStep

Sets the NSButtonCell's font to fontObject. The key equivalent font size is changed to match the fontObject if needed.

See Also: [NSCell -font] -keyEquivalentFont -setKeyEquivalentFont: -setKeyEquivalentFont:size:

### setGradientType:

- (void) setGradientType: (NSGradientType)gradientType;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setHighlightsBy:

- (void) setHighlightsBy: (NSInteger)mask;
Availability: OpenStep

Sets a mask describing how the button cell is highlighted :

NSNoCellMask, NSContentsCellMask,NSPushInCellMask,NSChangeGrayCellMask, NSChangeBackgroundCellMask

See Also : -highlightsBy

### setImageDimsWhenDisabled:

- (void) setImageDimsWhenDisabled: (BOOL)flag;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setImagePosition:

- (void) setImagePosition: (NSCellImagePosition)aPosition;
Availability: OpenStep

Sets the image position. The GNUstep implementation depends only on the image position. If the image position is set to NSNoImage then the type is set to NSTextCellType , to NSImageCellType otherwise

See Also: -imagePosition

### setImageScaling:

- (void) setImageScaling: (NSImageScaling)scaling;
Availability: MacOS-X 10.5.0
Description forthcoming.

### setKeyEquivalent:

- (void) setKeyEquivalent: (NSString*)key;
Availability: OpenStep

Sets the NSButtonCell's key equivalent to key. The key equivalent and its modifier mask are used to simulate the click of the button in [NSButton -performKeyEquivalent:] . By default NSButton hasn't key equivalent.

See Also: -keyEquivalent -setKeyEquivalentModifierMask: [NSButton -performKeyEquivalent:]

### setKeyEquivalentFont:

- (void) setKeyEquivalentFont: (NSFont*)fontObj;
Availability: OpenStep

Sets the NSFont of the key equivalent to fontObject.

See Also: -keyEquivalentFont -setFont:

### setKeyEquivalentFont: size:

- (void) setKeyEquivalentFont: (NSString*)fontName size: (float)fontSize;
Availability: OpenStep

Sets the NSFont with size fontSize of the key equivalent to fontName.

See Also: -keyEquivalentFont -setKeyEquivalentFont: -setFont:

### setKeyEquivalentModifierMask:

- (void) setKeyEquivalentModifierMask: (NSUInteger)mask;
Availability: OpenStep

Sets the modifier mask of the NSButtonCell's key equivalent to mask. The key equivalent and its modifier mask are used to simulate the click of the button in [NSButton -performKeyEquivalent:] . By default the mask is 0.

See Also: -keyEquivalentModifierMask -setKeyEquivalent: [NSButton -performKeyEquivalent:]

### setPeriodicDelay: interval:

- (void) setPeriodicDelay: (float)delay interval: (float)interval;
Availability: OpenStep

Sets the NSButtonCell's delay and interval parameters used when NSButton sends continouly action messages. By default delay is 0.4 and interval is 0.075.

See Also: -getPeriodicDelay:interval: [NSCell -trackMouse:inRect:ofView:untilMouseUp:]

### setShowsBorderOnlyWhileMouseInside:

- (void) setShowsBorderOnlyWhileMouseInside: (BOOL)show;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setShowsStateBy:

- (void) setShowsStateBy: (NSInteger)mask;
Availability: OpenStep
Description forthcoming.

### setSound:

- (void) setSound: (NSSound*)aSound;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setTitle:

- (void) setTitle: (NSString*)aString;
Availability: OpenStep

Sets the NSButtonCell's title to aString.

### setTitleWithMnemonic:

- (void) setTitleWithMnemonic: (NSString*)aString;
Availability: MacOS-X 10.0.0
Description forthcoming.

### setTransparent:

- (void) setTransparent: (BOOL)flag;
Availability: OpenStep

Sets whether the button cell is transparent.

See Also: -isTransparent

### showsBorderOnlyWhileMouseInside

- (BOOL) showsBorderOnlyWhileMouseInside;
Availability: MacOS-X 10.0.0
Description forthcoming.

### showsStateBy

- (NSInteger) showsStateBy;
Availability: OpenStep
Description forthcoming.

### sound

- (NSSound*) sound;
Availability: MacOS-X 10.0.0
Description forthcoming.

### title

- (NSString*) title;
Availability: OpenStep

Returns the NSButtonCell's title.

## Instance Variables for NSButtonCell Class

### _altContents

@protected NSString* _altContents;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _altImage

@protected NSImage* _altImage;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _backgroundColor

@protected NSColor* _backgroundColor;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _bezel_style

@protected NSBezelStyle _bezel_style;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _delayInterval

@protected float _delayInterval;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _gradient_type

@protected NSGradientType _gradient_type;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _highlightsByMask

@protected NSInteger _highlightsByMask;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _imageScaling

@protected NSImageScaling _imageScaling;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _keyEquivalent

@protected NSString* _keyEquivalent;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _keyEquivalentFont

@protected NSFont* _keyEquivalentFont;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _keyEquivalentModifierMask

@protected NSUInteger _keyEquivalentModifierMask;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _repeatInterval

@protected float _repeatInterval;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _showAltStateMask

@protected NSInteger _showAltStateMask;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

### _sound

@protected NSSound* _sound;
Availability: OpenStep
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.

Up