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

9.1 Creating a toolbar button

To create a toolbar button you can do:

(setf print-button
      (make-instance 'toolbar-button
                     :image :std-print
                     :text "Print Something"
                     :name :print-something))

You should supply image, text and name. This is because the user can customize the toolbar such that one (or all) of these appear, as described in 9.6 Modifying toolbars.

A toolbar-button cannot be displayed directly. To include it in an interface toolbar, do:

(display
 (make-instance
  'interface
  :toolbar-items (list print-button)))

CAPI User Guide and Reference Manual (Macintosh version) - 01 Dec 2021 19:31:21