Inherits From:
NSCell : NSObject
Conforms To:
NSCoding, NSCopying (NSCell)
NSObject (NSObject)
Declared In:
AppKit/NSBrowserCell.h
Many of NSBrowserCell's methods are designed to interact with NSBrowser and NSBrowser's delegate. The delegate implements methods for loading the NSCells in NSBrowser by setting their values and status. If your code needs access to a specific NSBrowserCell, you can use the NSBrowser method loadedCellAtRow:column:
.
Because NSBrowserCells do not inherit from NSActionCell, they don't hold target and action values and thus don't participate in the target/action paradigm of the Application Kit. However, NSBrowser does allow you to specify a target and an action, and you can obtain the last selected NSBrowserCell by sending selectedCell
to an NSBrowser.
You may find it useful to create a subclass of NSBrowserCell to alter its behavior and to enable it to work with and display the type of data you wish to represent. Use NSBrowser's setCellClass:
or setCellPrototype:
methods to have it use your subclass.
See the NSBrowser class specification for more details. In particular, the class description and the "Methods Implemented by the Delegate" section describe how the NSBrowser's delegate interacts with both NSBrowser and NSBrowserCells.
branchImage
Returns the default image for branch NSBrowserCells (a right-pointing triangle). 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
.
See also:
- alternateImage
, + highlightedBranchImage
, - setAlternateImage:
highlightedBranchImage
Returns the default NSImage for branch NSBrowserCells that are highlighted (a lighter version of the image returned by branchImage
). Override this method if you want a different image.
See also:
+ branchImage
, - alternateImage
, - setAlternateImage:
alternateImage
Returns this NSBrowserCell's image for the highlighted state or nil
if no image is set.
See also:
- setAlternateImage:
isLeaf
Returns whether the NSBrowserCell is a leaf or a branch cell. 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 NSBrowserCells. A leaf NSBrowserCell has no image, indicating that the user has reached a terminal piece of information; it doesn't point to additional information.
See also:
- setLeaf:
isLoaded
Returns YES if all the NSBrowserCell's state has been set and the cell is ready to display.
See also:
- setLoaded:
reset
Unhighlights the NSBrowserCell and sets its state to 0 (NO).
See also:
- set
set
Highlights the NSBrowserCell and sets its state to 1 (YES).
See also:
- reset
setAlternateImage:
(NSImage *)newAltImage
Sets this NSBrowserCell's image for the highlighted state, retaining the image. If newAltImage is nil
, it removes the alternate image for the NSBrowserCell.
See also:
- alternateImage
setLeaf:
(BOOL)flag
Sets whether the NSBrowserCell is a leaf or a branch cell. 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 NSBrowserCells. A leaf NSBrowserCell has no image, indicating that the user has reached a terminal piece of information; it doesn't point to additional information.
See also:
- isLeaf
setLoaded:
(BOOL)flag
Sets whether the NSBrowserCell's state has been set to 1 (YES) and the cell is ready to display.
See also:
- isLoaded