Skip to main content
Version: Dev

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​

LayoutBehavior
Column(gap=0)Vertical stack
Row(gap=0)Horizontal stack
Grid(rows, cols, gap=0)Fixed grid
ColumnFill / RowFill / GridFillStretch children to fill the parent
FreeLayoutNo 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.