wijjit.layout.engine.VStack
- class wijjit.layout.engine.VStack(children=None, width='fill', height='fill', spacing=0, padding=0, margin=0, align_h='stretch', align_v='stretch', id=None)[source]
Vertical stacking container.
Arranges children vertically with optional spacing.
- Parameters:
children (
listofLayoutNode, optional) – Child nodeswidth (
int,str, orSize, optional) – Width specification (default: “fill”)height (
int,str, orSize, optional) – Height specification (default: “fill”)spacing (
int, optional) – Spacing between children (default: 0)padding (
int, optional) – Padding around children (default: 0)margin (
intortupleofint, optional) – Margin around container (default: 0)align_h (
{"left", "center", "right", "stretch"}, optional) – Horizontal alignment of children (default: “stretch”)align_v (
{"top", "middle", "bottom", "stretch"}, optional) – Vertical alignment of children (default: “stretch”)id (
str, optional) – Node identifier
- __init__(children=None, width='fill', height='fill', spacing=0, padding=0, margin=0, align_h='stretch', align_v='stretch', id=None)[source]
Methods
__init__([children, width, height, spacing, ...])add_child(child)Add a child node.
assign_bounds(x, y, width, height)Assign bounds to container and position children vertically.
Calculate constraints for vertical stack.
collect_elements()Collect all elements from children.
get_height_for_width(width)Sum the children's heights at the widths this column would give them.
- calculate_constraints()[source]
Calculate constraints for vertical stack.
Width is the maximum of children widths. Height is the sum of children heights plus spacing.
- Returns:
Calculated constraints
- Return type: