
1 CAPI Reference Entries
tab-layout has two distinct modes. The first lays out a number of panes in a switchable layout. Each pane has an associated tab which, when clicked on, pulls the pane to the front. In the second mode the tabs are linked to a:selection-callback as forbutton-panel.
choice
simple-pinboard-layout
description
items
visible-child-functionThe visible children for a given selection.
key-functionitems list.
print-functionThe function used to print a name on each tab.
callback-type
selection-callbackThe function called when a tab is selected.
visible-child-function is used to specify which child to make visible for a given tab selection.
selection-callback, in a similar way to a button panel callback. In this mode the :description slot is used to describe the main layout of the tab pane.
:items list.
(defun switchable-tab-layout ()
(let* ((red-pane (make-instance
'capi:output-pane
:background :red))
(blue-pane (make-instance
'capi:output-pane
:background :blue))
(tl (make-instance
'capi:tab-layout
:items (list (list "Red" red-pane)
(list "Blue" blue-pane))
:print-function 'car
:visible-child-function 'second)))
(capi:contain tl)))
(switchable-tab-layout)
(defun non-switchable-tab-layout (tabs)
(let* ((gp (make-instance
'capi:graph-pane))
(tl (make-instance
'capi:tab-layout
:description (list gp)
:items tabs
:visible-child-function nil
:key-function nil
:print-function (lambda (x)
(format nil "~R" x))
:callback-type :data
:selection-callback
#'(lambda (data)
(setf (capi:graph-pane-roots gp)
(list data))))))
(capi:contain tl)))
(non-switchable-tab-layout '(1 2 4 5 6))
callbackssimple-layoutswitchable-layout

Generated with Harlequin WebMaker