All Manuals > CAPI Reference Manual > 1 CAPI Reference Entries

NextPrevUpTopContentsIndex

calculate-constraints

Generic Function
Summary

Calculates the internal constraints of a pane.

Package

capi

Signature

calculate-constraints pane

Arguments

pane

A CAPI pane or layout.

Description

The generic function calculate-constraints calculates the internal constraints for pane according to the sizes of its children, and sets these values into pane 's geometry cache.

When the pane does not scroll in the relevant dimension, all the geometry hints ( :external-min-width , :visible-max-height and so on) override the values that are computed by calculate-constraints .

See "Width and Height Constraints" in the CAPI User Guide for description of internal and external constraints.

The CAPI calls calculate-constraints for each pane and layout that it displays.

When creating your own layout, you should define a method for calculate-constraints that sets the values of the following geometry slots based on the constraints of its children.

%min-width%

The minimum width of pane.

%max-width%

The maximum width of pane.

%min-height%

The minimum height of pane.

%max-height%

The maximum height of pane.

(See with-geometry.)

The constraints of any CAPI element can be found by calling get-constraints.

See also

calculate-layout
define-layout
get-constraints
element
layout
with-geometry


CAPI Reference Manual - 15 Dec 2011

NextPrevUpTopContentsIndex