Open generic function
Called by compose-space to calculate space requirements for a child.
do-compose-space pane #key width height => space-req
<sheet>.
<integer>.
<integer>.
<space-requirement>.
duim-layouts
duim-layouts
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.
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;