has two distinct modes. Switchable mode lays 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 callback mode the tabs are linked to a
as for button-panel.
The main layout description.
Specifies the tabs of the tab layout.
Returns the visible child for a given selection in switchable mode.
A generalized boolean which influences the initial size of the layout.
Specifies a function to use in referring to items in the
The function used to print a name on each tab.
The type of data passed to the callback function in callback mode.
The function called when a tab is selected, in callback mode.
has one of two distinct modes. It is in switchable mode if
is supplied and non-
. It is in callback mode otherwise.
In switchable mode, the tab layout consists of a number of panes, each with its own tab. Clicking on a tab pulls the corresponding pane to the front. In this mode the tab layout is like a switchable-layout with the switching performed by the user selecting a tab. In this mode the
is used to specify which child to make visible for a given tab selection.
In callback mode the tab layout does not work as a switchable layout, and the result of any selection is specified using a callback specified by
, in a similar way to a button-panel callback. In this mode the
slot is used to describe the main layout of the tab pane.
In either mode
influences the initial size of the layout. When
the constraints of the tab layout depend only on its currently visible tab. Switching to a different tab might cause the layout to resize. When
, the constraints depend on all of the tabs, including those that are not visible. This might increase the time taken to create the tab layout initially, but can prevent unexpected resizing later. The default value of
The following example shows the use of the switchable mode of
. Each tab is linked to an output pane by pairing them in the
(defun switchable-tab-layout ()
(let* ((red-pane (make-instance
(list (list "Red" red-pane)
(list "Blue" blue-pane))
Here is an example of the callback mode of
, which uses the selection of a tab to change the nodes of a graph pane through the
(defun non-switchable-tab-layout (tabs)
(let* ((gp (make-instance
:description (list gp)
(format nil "~R" x))
(setf (capi:graph-pane-roots gp)
(non-switchable-tab-layout '(1 2 4 5 6))
LispWorks CAPI Reference Manual - 17 Mar 2008