All Manuals > CAPI User Guide and Reference Manual > 9 Adding Toolbars

9.6 Modifying toolbars

An interface toolbar can be customized by the user. It can also be manipulated programmatically.

9.6.1 User-customization of toolbars

The user can change toolbar state, that is the set of visible toolbar items, their order and their appearance. The user does this via the context menu on the toolbar. This menu includes commands to display the button images or titles (or both), and a Customize command to alter the set of items, including separators and spaces, and the order in which the items appear.

The toolbar context menu

To raise the customization dialog programmatically, call interface-customize-toolbar.

You can supply a default toolbar state in the initarg default-toolbar-states. This is used when the user presses the Default button in the Customize Toolbar dialog. You can read this value with interface-default-toolbar-states.

You can control the initial toolbar state by supplying the initarg toolbar-states.

9.6.2 Changing an interface toolbar programmatically

You can read and change the toolbar-states slot programmatically. Its value should be a toolbar state plist.

Be aware that toolbar-states may not be the same each time you read it, because the user may have changed it as described in 9.6.1 User-customization of toolbars.

For the details, see the accessor interface-toolbar-state.


CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:36