Table of Contents

splitpanel

`splitpanel()` creates a two-pane container. Each pane can hold one child component.

Constructor

splitpanel()

Creates a split panel object.

split = splitpanel().position(10, 10).size(480, 260);

Common Component Methods

Most visible GUI controls support these methods:

Method Returns Description
`position(x, y)` self Sets the component position in pixels.
`size(width, height)` self Sets component size in pixels. Width and height are clamped to at least 1.
`visible(enabled)` self Shows or hides the component.
`enabled(enabled)` self Enables or disables user interaction.

Common component properties:

Property Type Description
`position_x` number Current x position.
`position_y` number Current y position.
`size_width` number Current width.
`size_height` number Current height.
`visible` boolean Current visible state.
`enabled` boolean Current enabled state.

Methods

Method Returns Description
`orientation_left_right()` self Places panes left and right.
`orientation_top_bottom()` self Places panes top and bottom.
`resize_mode_proportional()` self Keeps split position proportional during resize.
`resize_mode_fixed_first()` self Keeps first pane size fixed during resize.
`resize_mode_fixed_second()` self Keeps second pane size fixed during resize.
`first(component)` self Sets first pane component.
`second(component)` self Sets second pane component.
`first_visible(enabled)` self Shows or hides first pane.
`second_visible(enabled)` self Shows or hides second pane.
`split_ratio(value)` self Sets proportional split ratio.
`first_size(size)` self Sets first pane size in fixed-size mode.
`second_size(size)` self Sets second pane size in fixed-size mode.
`splitter(size)` self Sets splitter size.
`min_sizes(first, second)` self Sets minimum pane sizes.

Example

left = panel().border(true);
right = panel().border(true);
split = splitpanel()
    .position(10, 10)
    .size(480, 260)
    .first(left)
    .second(right)
    .split_ratio(0.35);
 
window().title("Split").size(520, 320).add(split).show();

Previous: group

Next: label