All Manuals > CAPI User Guide and Reference Manual > 21 CAPI Reference Entries

NextPrevUpTopContentsIndex

static-layout

Class
Summary

A layout that allows its children to be positioned anywhere within itself.

Package

capi

Superclasses

layout

Subclasses

pinboard-layout

Initargs

:fit-size-to-children

A generalized boolean.

Description

The class static-layout is a layout that allows its children to be positioned anywhere within itself.

When a static-layout lays out its children, it positions them at the x and y specified as hints (using :x and :y), and sizes them to their minimum size (which can be specified using :visible-min-width and :visible-max-width).

If fit-size-to-children is true, the static-layout is made sufficiently large to accommodate all of its children, and grows and modifies its scrollbars (if they exist) if necessary when a child is added. This is the default behavior. Otherwise the static layout has a minimum size of one pixel by one pixel which is not affected by the size of its children. If you need the sizing capabilities, then use the class simple-layout which surrounds a single child, and adopts the size constraints of that child.

Example

Here is an example of a static layout placing simple panes at arbitrary positions inside itself.

(capi:contain 
 (make-instance
  'capi:static-layout
  :description
  (list (make-instance
         'capi:text-input-pane
         :x 20
         :y 100)
        (make-instance
         'capi:push-button-panel
         :x 30
         :y 200
         :items '(1 2 3))))
 :best-width 300 :best-height 300)

There are further examples in Self-contained examples.

See also

pinboard-layout


CAPI User Guide and Reference Manual (Macintosh version) - 3 Aug 2017

NextPrevUpTopContentsIndex