A switchable layout allows you to place CAPI objects on top of one another and determine which object is displayed on top through Lisp code, possibly linked to a button or menu option through a callback. Switchable layouts are set up using a
switchable-layout
element in a
make-instance
. As with the other layouts, such as
column-layout
and
row-layout
, the elements to be organized are given as a list to the
:description
keyword. Here is an example:
(setq switching-panes (make-instance
'switchable-layout
:description (list red-pane green-pane)))
(contain switching-panes)
Note that the default pane to be displayed is the red pane, which was the first pane in the description list. The two panes can now be switched between using
switchable-layout-visible-child
:
(apply-in-pane-process
switching-panes #'(setf switchable-layout-visible-child)
green-pane switching-panes)
(apply-in-pane-process
switching-panes #'(setf switchable-layout-visible-child)
red-pane switching-panes)