Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSToolbarItemMBS class.
NSToolbarItemMBS.allowsDuplicatesInToolbar as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns true to allow dragging the receiver into the toolbar at more than one position, otherwise false.
You use this method by overriding it in a subclass to always return true; typically, you wouldn't call it. By default, if an item with the same identifier is already in the toolbar, dragging it in again will effectively move it to the new position.
(Read only property)
NSToolbarItemMBS.autovalidates as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
By default NSToolbar automatically invokes the receiver's validate method on a regular basis. If your validate method is time consuming, you can disable auto validation on a per toolbar item basis.
(Read and Write property)
Some examples using this property:
NSToolbarItemMBS.backgroundTintColor as NSColorMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 25.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
For macOS 26 or newer.
(Read and Write property)
NSToolbarItemMBS.Bordered as Boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 21.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Defaults to false.
Requires macOS 10.15 or newer.
(Read and Write property)
NSToolbarItemMBS.ClassName as String
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 15.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read only property)
NSToolbarItemMBS.ClassPath as String
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 15.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Useful for debugging to know what super classes the window has.
(Read only property)
NSToolbarItemMBS.Enabled as boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
For a view item, this method calls isEnabled/setEnabled on the view if it responds and returns the result.
(Read and Write property)
NSToolbarItemMBS.Handle as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
NSToolbarItemMBS.Hidden as Boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 24.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
When an item is hidden it will not be visible in the toolbar. The item will still be visible in the customization panel. Because hidden items may be visible during user customization, use the `visible` property to determine if an item is currently displayed. Note that even hidden toolbar items are sync'd to other toolbars with a shared identifier, but its `hidden` state can be unique to each instance. Use this property to show a toolbar item in one toolbar instance but not another.
Available on macOS 15.0 or newer.
(Read and Write property)
NSToolbarItemMBS.image as NSImageMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
For a custom view item (one whose view has already been set), this method calls setImage on the view if it responds. If image contains multiple representations, NSToolbarItem chooses the most appropriately sized representation when displaying.
(Read and Write property)
NSToolbarItemMBS.itemIdentifier as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns the receiver's identifier, which was provided in the initializer.
(Read only property)
NSToolbarItemMBS.label as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The length of the label should be appropriate and not too long. The label may be empty.
(Read and Write property)
NSToolbarItemMBS.MaxSize as NSSizeMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
NSToolbarItemMBS.menuFormRepresentation as NSMenuItemMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
By default, this method returns nil, even though there is a default menu form representation.
(Read and Write property)
NSToolbarItemMBS.MinSize as NSSizeMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
NSToolbarItemMBS.Navigational as Boolean
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 21.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Navigation items may be specially positioned by the system outside the normal list of items of the toolbar in the order specified by toolbarDefaultItemIdentifiers.
Requires macOS 11.0 or newer.
(Read and Write property)
NSToolbarItemMBS.paletteLabel as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
An item must have a palette label if the customization palette is to be used, and for most items it is reasonable to set paletteLabel to be the same value as label. One reason for paletteLabel to be different from label would be if it's more descriptive; another might be if there is no label.
(Read and Write property)
Some examples using this property:
NSToolbarItemMBS.Style as integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 25.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The default style is plain.
Prominent style tints the background. If a background tint color is set, it uses it; otherwise, it uses the app’s or system’s accent color. If grouped with other items, it moves to its own to avoid tinting other items' background.
For macOS 26 or newer.
(Read and Write property)
NSToolbarItemMBS.tag as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
You can use the tag for your own custom purpose.
(Read and Write property)
NSToolbarItemMBS.Title as String
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 21.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
For custom views, this method will call setTitle:/title on the view if it responds.
(forwards to -view if it responds)
Requires macOS 10.15 or newer.
(Read and Write property)
NSToolbarItemMBS.toolbar as NSToolbarMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read only property)
NSToolbarItemMBS.toolTip as string
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
NSToolbarItemMBS.view as NSViewMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
view: The view for the receiver. The view and all of its contents must conform to the NSCoding protocol if the toolbar supports customization.
Note that many of the set/get methods are implemented by calls forwarded to view, if it responds to it.
(Read and Write property)
NSToolbarItemMBS.visibilityPriority as Integer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| property | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
(Read and Write property)
The items on this page are in the following plugins: MBS MacControls Plugin.