Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSToolbarMBS class.

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
Constructor for creating an instanced based on an existing handle.

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
The constructor.

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
Inserts the specified item at the specified index.

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.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
Returns the receiver's current items, in order.

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
Removes the specified item.

Typically, you should not call this method; you should let the user reconfigure the toolbar.

Index is zero based.

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
Runs the receiver's customization palette.

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
Called on window updates to validate the visible items.

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
Returns the receiver's currently visible items.

Items in the overflow menu are not considered visible.

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


The biggest plugin in space...