NextPrevUpTopContentsIndex

switchable-layout

Class
Summary

A subclass of simple-layout that displays only one of its children at a time, and provides functionality for switching the displayed child to one of the other children.

Package

capi

Superclasses

simple-layout

Initargs

:visible-child

The currently visible pane from the children.

Readers

switchable-layout-visible-child

Description

The switchable-layout has a description which is its list of children. The argument visible-child specifies the initially visible child (which defaults to the first of the children).

switchable-layout inherits all of its layout behavior from simple-layout as it only ever lays out one child at a time.

Example
(setq children (list
                (make-instance 'capi:push-button
                               :text "Press Me")
                (make-instance 'capi:list-panel
                               :items '(1 2 3 4 5))))
 
(setq layout (capi:contain
              (make-instance
               'capi:switchable-layout
               :description children)))
 
(capi:apply-in-pane-process 
 layout #'(setf capi:switchable-layout-visible-child)
 (second children) layout)
 
(capi:apply-in-pane-process 
  layout #'(setf capi:switchable-layout-visible-child) 
  (first children) layout)

There is a further example in the file examples/capi/layouts/switchable.lisp .

See also

layout
switchable-layout-switchable-children


LispWorks CAPI Reference Manual - 25 Jul 2006

NextPrevUpTopContentsIndex