Class

NSToolbarItem

A item in a window's toolbar.

Overview

If an NSToolbarItem has an NSSearchField instance as its view, that search field automatically has its minimum and maximum size adjusted to the system-specified standard values (currently 140 and 240 points).

Topics

Creating a toolbar item

init(itemIdentifier: NSToolbarItem.Identifier)

Initialize the receiver with a given identifier.

Managing attributes

var toolbar: NSToolbar?

The toolbar that is using the receiver.

var label: String

The receiver’s label.

var paletteLabel: String

The label that appears when the receiver is in the customization palette.

var toolTip: String?

The tooltip used when the receiver is displayed in the toolbar.

var menuFormRepresentation: NSMenuItem?

The receiver’s menu form representation.

var tag: Int

The receiver’s tag.

var target: AnyObject?

The receiver’s target.

var action: Selector?

The receiver’s action.

var isEnabled: Bool

A Boolean value that indicates whether the receiver is enabled.

var image: NSImage?

The image of the receiver.

var view: NSView?

The receiver’s view.

var minSize: NSSize

The receiver’s minimum size.

var maxSize: NSSize

The receiver’s maximum size.

Visibility priority

Validation

func validate()

This method is called by the receiver’s toolbar during validation.

var autovalidates: Bool

A Boolean value that indicates whether the receiver is automatically validated by the toolbar.

Controlling duplicates

var allowsDuplicatesInToolbar: Bool

A Boolean value that indicates whether the receiver can be represented in the toolbar at more than one position.

Constants

Standard Identifiers

NSToolbarItem defines the following standard toolbar item identifiers.

See Also

Items

class NSToolbarItemGroup

A group of subitems in a toolbar item.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software