Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSToolbarMBS class.
NSToolbarMBS.centeredItemIdentifiers as String()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Toolbar | MBS MacControls Plugin | 24.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSToolbarMBS.Constructor(Handle as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Toolbar | MBS MacControls Plugin | 21.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Useful if you get a NSToolbar reference from a declare.
The object is retained.
See also:
NSToolbarMBS.Constructor(Identifier as string)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Initializes a newly allocated toolbar with the specified identifier.
identifier is never seen by users and should not be localized.
See also:
NSToolbarMBS.insertItemWithItemIdentifier(identifier as string, atIndex as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Identifier: The identifier of the item to insert.
index: The index at which to insert the item.
If the toolbar needs a new instance, it will get it from itemForItemIdentifier. Typically, you should not call this method; you should let the user reconfigure the toolbar.
NSToolbarMBS.itemIdentifiers as String()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Toolbar | MBS MacControls Plugin | 24.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Setting this property will set the current items in the toolbar by diffing against items that already exist.
Use this with great caution if `allowsUserCustomization` is enabled as it will override any customizations the user has made.
Available on macOS 15.0 or newer.
NSToolbarMBS.items as NSToolbarItemMBS()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSToolbarMBS.removeItemAtIndex(index as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Typically, you should not call this method; you should let the user reconfigure the toolbar.
Index is zero based.
NSToolbarMBS.removeItemWithItemIdentifier(itemIdentifier as String)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Toolbar | MBS MacControls Plugin | 24.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
If multiple items share the same identifier (as is the case with space items) all matching items will be removed. To remove only a single space item, use removeItemAtIndex instead.
Any change made will be propagated immediately to all other toolbars with the same identifier.
Available on macOS 15.0 or newer.
NSToolbarMBS.runCustomizationPalette
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSToolbarMBS.setCenteredItemIdentifiers(Identifiers() as String)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Toolbar | MBS MacControls Plugin | 24.5 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Set this property to the items you want to appear together in the center of the toolbar. Specify the initial order of the items using the toolbarDefaultItemIdentifiers event.
NSToolbarMBS.validateVisibleItems
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
You typically use this method by overriding it in a subclass. The default implementation of this method iterates through the list of visible items, sending each a validate message. Override it and call super if you want to know when this method is called.
In Mac OS X v 10.6 and later toolbars no longer automatically validate for some events, including: NSLeftMouseDragged, NSRightMouseDragged, NSOtherMouseDragged, NSMouseEntered, NSMouseExited, NSScrollWheel, NSCursorUpdate, NSKeyDown. In addition, validation for NSKeyUp and NSFlagsChanged events is deferred with the timer restarting for every new deferrable event. So a sequence of key events will not trigger any validation at all, until either a pause of .85 seconds, or an event other than NSKeyUp or NSFlagsChanged is processed. This change was made as an optimization.
To trigger validation for a single toolbar manually, send the toolbar a validateVisibleItems message. To trigger validation for all toolbars, invoke NSApplication's setWindowsNeedUpdate passing true.
NSToolbarMBS.visibleItems as NSToolbarItemMBS()
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | Cocoa Toolbar | MBS MacControls Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Items in the overflow menu are not considered visible.
The items on this page are in the following plugins: MBS MacControls Plugin.