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 a Boolean value that indicates whether the receiver can be represented in the toolbar at more than one position.

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
Whether this item auto validates.

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.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
When set on an item without a custom view, the button produced will have a bordered style.

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
The name of this NSWindow class.

(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
The path of this NSView class.

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
A Boolean value that indicates whether the receiver is enabled.

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
The internal reference to the NSToolbarItem object.

(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
The image for this toolbar item.

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
The receiver's identifier.

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 label, which normally appears in the toolbar and in the overflow menu.

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
The maximum size.

(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
The menu form representation.

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
The minimum size.

(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
Whether or not the item behaves as a navigation item (i.e. back/forward) in the toolbar.

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
The label that appears when the receiver is in the customization palette.

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.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
The tag value.

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
Set and get the title of an item.

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
Returns the toolbar that is using the receiver.

(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
The tooltip to be used when the receiver is displayed in the toolbar.

(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
The custom view for this item.

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
The visibility priority.

(Read and Write property)

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


The biggest plugin in space...