Developer Documentation
PATH  Mac OS X Documentation > Application Kit Reference: Objective-C


[Previous] [Class List] [Next]

NSTableHeaderCell


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




Class Description


An NSTableHeaderCell is used by an NSTableHeaderView to draw its column headers. See the NSTableView class specification for more information on how it's used.

Subclasses of NSTableHeaderCell can override drawInteriorWithFrame:inView:, drawWithFrame:inView:, and highlight:withFrame:inView: to change the way headers appear. See the NSCell class specification, and the description below, for information on these methods.




Instance Methods



drawInteriorWithFrame:inView:

- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView

Draws the receiver's interior, as described for this same method in the NSCell class specification. NSTableHeaderCell's implementation overrides NSTextFieldCell's to draw the receiver's image if it has one, instead of its string value. If the receiver has no image, it simply draws its string value. This allows column headers to be labeled with images rather than text.

To make an NSTableHeaderCell display an image, use NSCell's setImage: method, which changes the receiver's cell type to NSImageCellType and stores the image provided. To restore it to displaying a text label, supply a new title using setStringValue:, which removes the image and reverts the receiver's cell type to NSTextCellType.




[Previous] [Next]