Next Page > Hide TOC

NSBrowserCell Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in Mac OS X v10.0 and later.
Companion guide
Declared in
NSBrowserCell.h
Related sample code

Overview

The NSBrowserCell class is the subclass of NSCell used by default to display data in the columns of an NSBrowser object. (Each column contains an NSMatrix filled with NSBrowserCell objects.)

The NSBrowserCell class implements the user interface of NSBrowser.

Tasks

Getting Browser Cell Information

Configuring Browser Cells

Managing Browser Cell State

Class Methods

branchImage

Returns the default image for branch cells in a browser.

+ (NSImage *)branchImage

Return Value

The default image used for branch NSBrowserCell objects. The default image is a right-pointing triangle.

Discussion

Override this method if you want a different image. To have a branch NSBrowserCell with no image (and no space reserved for an image), override this method to return nil.

Availability
See Also
Declared In
NSBrowserCell.h

highlightedBranchImage

Returns the default image for branch browser cells that are highlighted.

+ (NSImage *)highlightedBranchImage

Return Value

The default image used for branch NSBrowserCell objects that are highlighted. This is a lighter version of the image returned by branchImage.

Discussion

Override this method if you want a different image.

Availability
See Also
Declared In
NSBrowserCell.h

Instance Methods

alternateImage

Returns the receiver’s image for the highlighted state.

- (NSImage *)alternateImage

Return Value

The image used for the browser cell in its highlighted state or nil if no image is set.

Availability
See Also
Declared In
NSBrowserCell.h

highlightColorInView:

Returns the highlight color that the receiver wants to display.

- (NSColor *)highlightColorInView:(NSView *)controlView

Parameters
controlView

The view for which to return the highlight color.

Return Value

The highlight color.

Availability
Declared In
NSBrowserCell.h

image

Returns the receiver’s image.

- (NSImage *)image

Return Value

The image of the receiver or nil if no image is set.

Availability
See Also
Declared In
NSBrowserCell.h

isLeaf

Returns whether the receiver is a leaf or a branch cell.

- (BOOL)isLeaf

Return Value

YES if the receiver is a leaf cell; otherwise NO.

Discussion

A branch NSBrowserCell has an image near its right edge indicating that more, hierarchically related information is available; when the user selects the cell, the NSBrowser displays a new column of NSBrowserCell objects. A leaf NSBrowserCell has no image, indicating that the user has reached a terminal piece of information; it doesn’t point to additional information.

Availability
See Also
Declared In
NSBrowserCell.h

isLoaded

Returns a Boolean value indicating whether the cell is ready to display.

- (BOOL)isLoaded

Return Value

YES if the receiver’s state has been set and the cell is ready to display; otherwise NO.

Availability
See Also
Declared In
NSBrowserCell.h

reset

Unhighlights the receiver and unsets its state.

- (void)reset

Availability
See Also
Declared In
NSBrowserCell.h

set

Highlights the receiver and sets its state.

- (void)set

Availability
See Also
Declared In
NSBrowserCell.h

setAlternateImage:

Sets the receiver’s image for the highlighted state, retaining the image.

- (void)setAlternateImage:(NSImage *)newAltImage

Parameters
newAltImage

The new image for the browser cell in its highlighted state. If newAltImage is nil, it removes the alternate image for the receiver. newAltImage is drawn vertically centered on the left edge of the browser cell.

Note that newAltImage is drawn at the given size of the image. NSBrowserCell does not set the size of the image, nor does it clip the drawing of the image. Make sure newAltImage is the correct size for drawing in the browser cell.

Availability
See Also
Declared In
NSBrowserCell.h

setImage:

Sets the receiver’s image, retaining the image.

- (void)setImage:(NSImage *)newImage

Parameters
newImage

The new image. If newImage is nil, it removes the image for the receiver. newImage is drawn vertically centered on the left edge of the browser cell.

Note that newImage is drawn at the given size of the image. NSBrowserCell does not set the size of the image, nor does it clip the drawing of the image. Make sure newImage is the correct size for drawing in the browser cell.

Availability
See Also
Declared In
NSBrowserCell.h

setLeaf:

Sets whether the receiver is a leaf or a branch cell.

- (void)setLeaf:(BOOL)flag

Parameters
flag

YES if the receiver is a leaf cell; otherwise NO.

Discussion

A branch NSBrowserCell has an image near its right edge indicating that more, hierarchically related information is available; when the user selects the cell, the NSBrowser displays a new column of NSBrowserCell objects. A leaf NSBrowserCell has no image, indicating that the user has reached a terminal piece of information; it doesn’t point to additional information.

Availability
See Also
Related Sample Code
Declared In
NSBrowserCell.h

setLoaded:

Sets whether the receiver’s state has been set and the cell is ready to display.

- (void)setLoaded:(BOOL)flag

Parameters
flag

YES if the receiver’s state has been set and the cell is ready to display; otherwise NO.

Availability
See Also
Declared In
NSBrowserCell.h

Next Page > Hide TOC


© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-04-01)


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.