A set of optional methods implemented by toolbar delegates to configure the toolbar and respond to changes.


protocol NSToolbarDelegate


Configuring a Toolbar

func toolbar(NSToolbar, itemForItemIdentifier: NSToolbarItem.Identifier, willBeInsertedIntoToolbar: Bool) -> NSToolbarItem?

Sent to request a new toolbar item; returns a toolbar item of the identified kind for the specified toolbar.

func toolbarAllowedItemIdentifiers(NSToolbar) -> [NSToolbarItem.Identifier]

Sent to discover the allowed item identifiers for a toolbar.

func toolbarDefaultItemIdentifiers(NSToolbar) -> [NSToolbarItem.Identifier]

Sent to discover the default item identifiers for a toolbar.

func toolbarSelectableItemIdentifiers(NSToolbar) -> [NSToolbarItem.Identifier]

Sent to discover the selectable item identifiers for a toolbar.

Responding to Additions and Deletions in the Toolbar

func toolbarWillAddItem(Notification)

Sent just before a new item is added to a toolbar.

func toolbarDidRemoveItem(Notification)

Sent just after an item has been removed from a toolbar.


Inherits From

Conforming Types

See Also

Configuring the Toolbar Contents

var delegate: NSToolbarDelegate?

The toolbar’s delegate.