A toolbar component is used to group several toolbar buttons together. Each component is separated from the surrounding components and buttons. Toolbar components are choices, and may be used to implement toolbars on which groups of buttons have single-selection or multiple-selection functionality.
capi
:images |
A list of images, in one-to-one correspondence with the items. |
:callbacks |
A list of callback functions, in one-to-one correspondence with the items. |
:names |
A list of names, in one-to-one correspondence with the items. |
:texts |
A list of strings, in one-to-one correspondence with the items. |
:tooltips |
A list of tooltip strings, in one-to-one correspondence with the items. |
:default-image-set |
An optional image-set object which can be used to specify images. See 5.10.4 image-list, image-set and image-locator for more details. |
:selection-function | |
A function to dynamically compute the selection. | |
:selected-item-function | |
A function to dynamically compute the selected item. | |
:selected-items-function | |
A function to dynamically compute the selected items. |
The class toolbar-component
inherits from choice, and hence has a list of items. Its behavior is broadly similar to button-panel.
items may be used to specify a mixture of toolbar-buttons and toolbar-component
s, or may contain arbitrary objects as items. The list may also contain CAPI panes, which will appear within the toolbar. This is typically used with text-input-pane, option-pane, and text-input-choice.
For items that are not toolbar buttons or toolbar components, a toolbar button is automatically created, using the appropriate elements of the images, callbacks, names, texts and tooltips lists. If no image is specified, the item itself is used as the image. For more information on acceptable values for images, see toolbar-button. Elements of images, callbacks, names, texts and tooltips corresponding to toolbar-button items or toolbar-component
items are ignored.
No more than one of selection-function, selected-item-function and selected-items-function should be non-nil. Each defaults to nil
. If one of these is non-nil, it should be a function which is called before the toolbar-component
is displayed and when update-toolbar is called and which determines which items are selected. The function takes a single argument, which is the interface of the toolbar-component
.
selection-function, if non-nil, should return a list of indices suitable for passing to the choice accessor (setf choice-selection)
.
selected-item-function, if non-nil, should return an object which is an item in the toolbar-component
, or is equal to such an item when compared by the toolbar-component
's test-function and key-function.
selected-items-function, if non-nil, should return a list of such objects.
(example-edit-file "capi/elements/toolbar")
toolbar
toolbar-button
3.12 Tooltips
9 Adding Toolbars
13.10 Working with images
CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:32:42