[Previous] [Class List] [Next]

NSTextFieldCell


Inherits from: NSActionCell : NSCell : NSObject
Conforms to: NSCoding
(NSCell)
NSCopying (NSCell)
NSObject (NSObject)
Declared in: AppKit/NSTextFieldCell.h




Class Description


NSTextFieldCell adds to NSCell's text-display capabilities by allowing you to set the color of both the text and its background. You can also specify whether the cell draws its background at all. All of the methods declared by this class are also declared by NSTextField, which uses NSTextFieldCells to draw and edit text.


Method Types


Setting the text color
- setTextColor:
- textColor
Controlling the background
- setBackgroundColor:
- backgroundColor
- setDrawsBackground:
- drawsBackground
Changing the field editor
- setUpFieldEditorAttributes:


Instance Methods



backgroundColor

- (NSColor *)backgroundColor

Returns the color of the background the receiver draws behind the text.

See Also: - drawsBackground, - backgroundColor (NSTextField), - setBackgroundColor:



drawsBackground

- (BOOL)drawsBackground

Returns YES if the receiver's cell draws its background color behind its text, NO if it draws no background.

See Also: - backgroundColor, - drawsBackground (NSTextField), - setDrawsBackground:



setBackgroundColor:

- (void)setBackgroundColor:(NSColor *)aColor

Sets the color of the background that the receiver draws behind the text to aColor.

See Also: - setDrawsBackground:, - setBackgroundColor: (NSTextField), - backgroundColor



setDrawsBackground:

- (void)setDrawsBackground:(BOOL)flag

Controls whether the receiver draws its background color behind its text. If flag is YES, then it does; if flag is NO, then it draws nothing behind its text.

See Also: - setBackgroundColor:, - setDrawsBackground: (NSTextField), - drawsBackground



setTextColor:

- (void)setTextColor:(NSColor *)aColor

Sets the color used to draw the receiver's text to aColor.

See Also: - setBackgroundColor:, - setTextColor: (NSTextField), - textColor



setUpFieldEditorAttributes:

- (NSText *)setUpFieldEditorAttributes:(NSText *)textObj

You never invoke this method directly; by overriding it, however, you can customize or replace the field editor. When you override this method, you should generally invoke super's implementation, and return the textObj argument. For information on field editors, see the "Field Editors" section of the NSWindow class description.

textColor

- (NSColor *)textColor

Returns the color used to draw the receiver's text.

See Also: - backgroundColor, - textColor (NSTextField), - setTextColor:




[Previous] [Next]