Platforms to show: All Mac Windows Linux Cross-Platform

NSToolbarItemMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa Toolbar MBS MacControls Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The class for Cocoa toolbar items.
Example
// configure a toolbar item, e.g. in the itemForItemIdentifier event of your CustomNSToolbarMBS subclass
Var item As New NSToolbarItemMBS("print")
item.label = "Print"
item.paletteLabel = "Print Document" // name in the customization palette
item.toolTip = "Print the current document"
item.image = NSImageMBS.imageWithSystemSymbolName("printer", "Print")

// several possible labels let the toolbar reserve enough room
Var labels() As String = Array("Print", "Print Document")
item.setPossibleLabels labels

Each item in an NSToolbar is an instance of NSToolbarItem.

Constants

Constant Value Description
NSToolbarItemVisibilityPriorityHigh 1000 One of the visibility priority constants. When a toolbar does not have enough space to fit all its items, it must push some items into the overflow menu. These values allow you to suggest a priority for a toolbar item. more
NSToolbarItemVisibilityPriorityLow -1000 One of the visibility priority constants. When a toolbar does not have enough space to fit all its items, it must push some items into the overflow menu. These values allow you to suggest a priority for a toolbar item. more
NSToolbarItemVisibilityPriorityStandard 0 One of the visibility priority constants. When a toolbar does not have enough space to fit all its items, it must push some items into the overflow menu. These values allow you to suggest a priority for a toolbar item. more
NSToolbarItemVisibilityPriorityUser 2000 One of the visibility priority constants. When a toolbar does not have enough space to fit all its items, it must push some items into the overflow menu. These values allow you to suggest a priority for a toolbar item. more

Styles

Constant Value Description
NSToolbarItemStylePlain 0 A plain style maintains the item’s standard appearance.
NSToolbarItemStyleProminent 1 For macOS 26 or newer.

Sub classes:

Blog Entries

Xojo Developer Magazine

Release notes

Some methods using this class:

Some events using this class:

Some examples using this class:

Some related classes:


The items on this page are in the following plugins: MBS MacControls Plugin.


NSToolbarItemGroupMBS   -   NSToolbarMBS


The biggest plugin in space...