cocoanstoolbar

How the nstoolbar customization is called


I am looking at this, but the documentation says that it will create a Customize Toolbar... menu.

What I am looking for is a way to have NSToolbar respond to the right click and display context menu where one of the item is "Customize...".

Will this functionality be turned on or I will have to do something extra? If I do, then what?

TIA!


Solution

  • If allowsUserCustomization is YES, the toolbar provides a context menu with a “Customize Toolbar…” item. You don't have to do anything else to make this menu work.

    In Xcode's macOS application template, the View menu of the menu bar contains a “Customize Toolbar…” menu item which is enabled or disabled automatically based on the setting of allowsUserCustomization of the front window's toolbar. You don't have to do anything to make this work either.

    If your app's main menu doesn't have the “Customize Toolbar…” menu item under any submenu, you can add one yourself by dragging a menu item out of the Objects Library. Connect the menu item's action to First Responder's runToolbarCustomizationPalette:.