wijjit.layout.engine.Container
- class wijjit.layout.engine.Container(children=None, width='auto', height='auto', spacing=0, padding=0, margin=0, align_h='stretch', align_v='stretch', id=None)[source]
Base container class for layout nodes with children.
- Parameters:
children (
listofLayoutNode, optional) – Child nodeswidth (
int,str, orSize, optional) – Width specification (default: “auto”)height (
int,str, orSize, optional) – Height specification (default: “auto”)spacing (
int, optional) – Spacing between children (default: 0)padding (
int, optional) – Padding around children (default: 0)margin (
intortupleofint, optional) – Margin around container. If int, applies uniformly to all sides. If tuple, specifies (top, right, bottom, left) margins. (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
- Variables:
- __init__(children=None, width='auto', height='auto', 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 absolute position and size (top-down pass).
calculate_constraints()Calculate size constraints (bottom-up pass).
Collect all elements from children.
get_height_for_width(width)Return the height this node needs when laid out at
width.- add_child(child)[source]
Add a child node.
- Parameters:
child (
LayoutNode) – Child node to add- Return type:
None