Next Previous Up Top Contents Index

7.3 DUIM-Layouts Module

do-compose-space

Open generic function

Summary

Called by compose-space to calculate space requirements for a child.

Signature

do-compose-space pane #key width height => space-req

Arguments

pane
An instance of type <sheet>.

width
An instance of type <integer>.

height
An instance of type <integer>.

Values

space-req
An instance of type <space-requirement>.

Library

duim-layouts

Module

duim-layouts

Description

This function is called by compose-space to calculate space requirements for a child. When calculating space requirements for children in classes of pane you have defined yourself, you should specialize this function by adding methods for it. However, you should not call do-compose-space explicitly: call compose-space instead.

Example

Assume that you have defined a new class of scroll bar as follows:

define class <my-scroll-bar>
  (<scroll-bar>,
   <leaf-pane>)
end class <test-scroll-bar>;

A new method for do-compose-space can be defined as follows:

define method do-compose-space
    (pane :: <my-scroll-bar>, #key width, height)
 => (space-req :: <space-requirement>)
  select (gadget-orientation(pane))
    #"horizontal" =>
      make(<space-requirement>,
           width: width | 50, 
           min-width: 50, 
           max-width: $fill,
           height: 10);
    #"vertical" =>
      make(<space-requirement>,
           width: 10,
           height: height | 50, 
           min-height: 50, 
           max-height: $fill);
  end
end method do-compose-space;

See also

compose-space, page 459


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index