Layouts
Layouts arrange children inside a Container.
panel = bf.gui.Container(bf.gui.Column(gap=8))
panel.add(
bf.gui.Label("Title"),
bf.gui.Button("OK"),
bf.gui.Button("Cancel"),
)
scene.root.add(panel)
Available layouts
| Layout | Behavior |
|---|---|
Column(gap=0) | Vertical stack |
Row(gap=0) | Horizontal stack |
Grid(rows, cols, gap=0) | Fixed grid |
ColumnFill / RowFill / GridFill | Stretch children to fill the parent |
FreeLayout | No automatic arrangement |
Layouts also drive keyboard focus navigation (arrows) inside interactive containers.
Grow weights
Children can claim leftover space with grow constraints (GrowH, GrowV) when using column/row layouts. See Constraints.