Mac Developer Library

Developer

AppKit Framework Reference NSBrowserCell Class Reference

Options
Deployment Target:

On This Page
Language:

NSBrowserCell

Inheritance


Conforms To


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.0 and later.

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.

  • Returns the default image for branch cells in a browser.

    Declaration

    Swift

    class func branchImage() -> NSImage

    Objective-C

    + (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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

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

    Declaration

    Swift

    class func highlightedBranchImage() -> NSImage!

    Objective-C

    + (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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Returns the receiver’s image.

    Declaration

    Swift

    var image: NSImage!

    Objective-C

    @property(strong) NSImage *image

    Return Value

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

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.2 and later.

    See Also

    – setImage:

  • Sets the receiver’s image, retaining the image.

    Declaration

    Swift

    var image: NSImage!

    Objective-C

    @property(strong) NSImage *image

    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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.2 and later.

    See Also

    – image

  • Returns the receiver’s image for the highlighted state.

    Declaration

    Swift

    var alternateImage: NSImage?

    Objective-C

    @property(strong) NSImage *alternateImage

    Return Value

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

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

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

    Declaration

    Swift

    var alternateImage: NSImage?

    Objective-C

    @property(strong) NSImage *alternateImage

    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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

  • Unhighlights the receiver and unsets its state.

    Declaration

    Swift

    func reset()

    Objective-C

    - (void)reset

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – set

  • Highlights the receiver and sets its state.

    Declaration

    Swift

    func set()

    Objective-C

    - (void)set

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – reset

  • isLeaf - isLeaf Available in OS X v10.0 through OS X v10.9

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

    Declaration

    Objective-C

    - (BOOL)isLeaf

    Return Value

    YEStrue if the receiver is a leaf cell; otherwise NOfalse.

    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.

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Available in OS X v10.0 through OS X v10.9.

    See Also

    – setLeaf:

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

    Declaration

    Swift

    var leaf: Bool

    Objective-C

    @property(getter=isLeaf) BOOL leaf

    Parameters

    flag

    YEStrue if the receiver is a leaf cell; otherwise NOfalse.

    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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – isLeaf

  • isLoaded - isLoaded Available in OS X v10.0 through OS X v10.9

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

    Declaration

    Objective-C

    - (BOOL)isLoaded

    Return Value

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

    Import Statement

    Objective-C

    @import AppKit;

    Availability

    Available in OS X v10.0 through OS X v10.9.

    See Also

    – setLoaded:

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

    Declaration

    Swift

    var loaded: Bool

    Objective-C

    @property(getter=isLoaded) BOOL loaded

    Parameters

    flag

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

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.

    See Also

    – isLoaded

  • Returns the highlight color that the receiver wants to display.

    Declaration

    Swift

    func highlightColorInView(_ controlView: NSView) -> NSColor?

    Objective-C

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

    Parameters

    controlView

    The view for which to return the highlight color.

    Return Value

    The highlight color.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.0 and later.