crystal.VerticalListJoint
A Joint specifying how elements are positioned in a VerticalList.
When a list has too much or not enough space to size each element at its desired size, they grow or shrink according to their grow/shrink factors. These factors are relative between elements of the list. For example, an element with a grow factor of 20 will grow twice as much as an element with a grow factor of 10 when filling extraneous space.
Constructor
VerticalListJoint are created by calling add_child on a VerticalList.
Methods
| Name | Description |
|---|---|
| grow | Returns the growth factor on this list element. |
| set_grow | Sets the growth factor on this list element. |
| set_shrink | Sets the shrink factor on this list element |
| set_horizontal_alignment | Sets how this element is aligned horizontally. |
| shrink | Returns the shrink factor on this list element. |
| horizontal_alignment | Returns how this element is aligned horizontally. |
Padding
VerticalListJoint objects transparently expose a Padding object, using the aliasing mechanism. Refer to the Padding documentation for a list of these methods.
Examples
local list = crystal.VerticalList:new();
local fixed_size = list:add_child(crystal.Image:new());
fixed_size:set_image_size(64, 64);
local filler = list:add_child(crystal.Image:new());
filler:set_image_size(64, 64);
filler:set_grow(1); -- This element will grow vertically to fill available space the list