UI module

split

procedure · 1 overloadsince 0.31.0Source

Two panes with a draggable divider. position is the first pane's size along axis (HORIZONTAL puts the panes side by side); the app keeps it so it can be saved. Use for pane: split(.HORIZONTAL, *width) { if pane == 0 { ... } else { ... } }.

split :: (
    axis: Axis,
    position: *float,
    options: Split_Options = .{},
    loc := #caller_location
) -> Split

Two panes with a draggable divider. position is the first pane's size along axis (HORIZONTAL puts the panes side by side); the app keeps it so it can be saved. Use for pane: split(.HORIZONTAL, *width) { if pane == 0 { ... } else { ... } }.

Parameters

axis: Axis
the direction the panes sit in.
position: *float
the first pane's size in points. It is clamped to the options' limits and updated while the divider is dragged.
options: Split_Options
the smallest and largest size of the first pane.
loc := #caller_location
the call site. It identifies the widget from one frame to the next, so leave the default.

Returns

See also