Mac Developer Library

Developer

AppKit Framework Reference NSPathControl Class Reference

Options
Deployment Target:

On This Page
Language:

NSPathControl

NSPathControl is a subclass of NSControl that represents a file system path or virtual path. More...

Inheritance


Import Statement


import AppKit @import AppKit;

Availability


Available in OS X v10.5 and later.
  • Returns the receiver’s path style.

    Declaration

    Swift

    var pathStyle: NSPathStyle

    Objective-C

    @property NSPathStyle pathStyle

    Return Value

    The style of the path control.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Sets the receiver’s path style.

    Declaration

    Swift

    var pathStyle: NSPathStyle

    Objective-C

    @property NSPathStyle pathStyle

    Parameters

    style

    The new path style.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    See Also

    – pathStyle

  • Sets the receiver’s background color.

    Declaration

    Swift

    @NSCopying var backgroundColor: NSColor?

    Objective-C

    @property(copy) NSColor *backgroundColor

    Parameters

    color

    The color to draw.

    Discussion

    By default, the background is set to a light blue color for NSPathStyleStandard and nil for the other styles. You can use [NSColor clearColor] to make the background transparent.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns the current background color of the receiver.

    Declaration

    Swift

    @NSCopying var backgroundColor: NSColor?

    Objective-C

    @property(copy) NSColor *backgroundColor

    Return Value

    The background color.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns the clicked cell.

    Declaration

    Swift

    func clickedPathComponentCell() -> NSPathComponentCell?

    Objective-C

    - (NSPathComponentCell *)clickedPathComponentCell

    Return Value

    The component cell that was clicked.

    Discussion

    The value returned is generally valid only when the action or double action is being sent.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    Deprecated in OS X v10.10.

  • Returns an array of the NSPathComponentCell objects currently being displayed.

    Declaration

    Swift

    func pathComponentCells() -> [AnyObject]

    Objective-C

    - (NSArray *)pathComponentCells

    Return Value

    The array of NSPathComponentCell objects.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    Deprecated in OS X v10.10.

  • Sets the array of NSPathComponentCell objects currently being displayed.

    Declaration

    Swift

    func setPathComponentCells(_ cells: [AnyObject])

    Objective-C

    - (void)setPathComponentCells:(NSArray *)cells

    Parameters

    cells

    An array of NSPathComponentCell objects.

    Discussion

    Each item in the array must be an instance of NSPathComponentCell or a subclass thereof. You cannot set this value to nil, but you can set it to an empty array using, for example, [NSArray array].

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    Deprecated in OS X v10.10.

  • Returns the receiver’s double-click action method.

    Declaration

    Swift

    var doubleAction: Selector

    Objective-C

    @property SEL doubleAction

    Return Value

    The action method invoked when the user double-clicks the receiver.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Sets the receiver’s double-click action.

    Declaration

    Swift

    var doubleAction: Selector

    Objective-C

    @property SEL doubleAction

    Parameters

    action

    The action method to invoke when the receiver is double-clicked.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns the path value displayed by the receiver.

    Declaration

    Swift

    @NSCopying var URL: NSURL?

    Objective-C

    @property(copy) NSURL *URL

    Return Value

    The path value.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    See Also

    – setURL:

  • setURL: setURL: Available in OS X v10.5 through OS X v10.9

    Sets the path value displayed by the receiver.

    Declaration

    Objective-C

    - (void)setURL:(NSURL *)url

    Parameters

    url

    The new path value to display.

    Discussion

    When setting, an array of NSPathComponentCell objects is automatically set based on the path in url. If url is a file URL (returns YEStrue from isFileURL), the images are automatically filled with file icons, if the path exists. The URL value itself is stored in the objectValue property of the cell.

    Import Statement

    Availability

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

    See Also

    – URL

  • Returns the receiver’s delegate.

    Declaration

    Swift

    weak var delegate: NSPathControlDelegate?

    Objective-C

    @property(weak) id<NSPathControlDelegate> delegate

    Return Value

    The receiver’s delegate.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Sets the receiver’s delegate.

    Declaration

    Swift

    weak var delegate: NSPathControlDelegate?

    Objective-C

    @property(weak) id<NSPathControlDelegate> delegate

    Parameters

    delegate

    The object to set as the receiver’s delegate.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

    See Also

    – delegate

  • Configures the default value returned from draggingSourceOperationMaskForLocal:.

    Declaration

    Swift

    func setDraggingSourceOperationMask(_ mask: NSDragOperation, forLocal isLocal: Bool)

    Objective-C

    - (void)setDraggingSourceOperationMask:(NSDragOperation)mask forLocal:(BOOL)isLocal

    Parameters

    mask

    The types of drag operations allowed.

    isLocal

    If YEStrue, mask applies when the drag destination object is in the same application as the receiver; if NOfalse, mask applies when the destination object is outside the receiver’s application.

    Discussion

    By default, draggingSourceOperationMaskForLocal: returns NSDragOperationEvery when isLocal is YEStrue and NSDragOperationNone when isLocal is NOfalse.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.5 and later.

  • Returns the menu that is used for the path control’s cells.

    Declaration

    Swift

    var menu: NSMenu?

    Objective-C

    @property(strong) NSMenu *menu

    Return Value

    An instance of NSMenu.

    Discussion

    This method overrides the NSView implementation of menu and forwards the message to the NSPathControlCell.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.

  • Sets the menu used for the path control’s cells.

    Declaration

    Swift

    var menu: NSMenu?

    Objective-C

    @property(strong) NSMenu *menu

    Parameters

    menu

    An instance of NSMenu.

    Discussion

    This method overrides the NSView implementation of setMenu: and forwards the message to the NSPathControlCell.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.6 and later.