Table of Contents

separator

`separator()` creates a horizontal or vertical visual separator.

Separators are used to visually divide sections in a custom dialog or form.

Constructor

separator()

Creates a separator object.

Item Description
Syntax `separator()`
Arguments none
Returns separator object
sep = separator().orientation_horizontal();

Properties

Properties are read-only. Use methods to change values.

Property Type Description
`position_x` number X position.
`position_y` number Y position.
`size_width` number Width.
`size_height` number Height.
`visible` boolean Visibility state.
`enabled` boolean Enabled state.
`orientation` string Current orientation: `horizontal` or `vertical`.

Common Object Methods

to_string()

Returns a display string for the object.

Item Description
Syntax `value.to_string()`
Arguments none
Returns string

Example:

text = value.to_string();

`clone()` is not supported for `separator`.

Common GUI Methods

Most visible GUI controls support these methods.

position(x, y)

Sets the component position in pixels.

Item Description
Syntax `component.position(x, y)`
Arguments `x`: x position; `y`: y position
Returns component object

Example:

label().position(20, 10);

size(width, height)

Sets the component size in pixels. Width and height are clamped to at least `1`.

Some container objects, such as `panel()` and `group()`, use `size(-1, -1)` as a special fit-parent mode.

Item Description
Syntax `component.size(width, height)`
Arguments `width`: width in pixels; `height`: height in pixels
Returns component object

Example:

textinput().size(220, 26);

visible(enabled)

Shows or hides the component.

Item Description
Syntax `component.visible(enabled)`
Arguments `enabled`: boolean
Returns component object

Example:

status.visible(false);

enabled(enabled)

Enables or disables user interaction with the component.

Item Description
Syntax `component.enabled(enabled)`
Arguments `enabled`: boolean
Returns component object

Example:

run_button.enabled(false);

Methods

orientation_horizontal()

Sets horizontal orientation.

Item Description
Syntax `separator.orientation_horizontal()`
Arguments none
Returns separator object
sep = separator().orientation_horizontal();

orientation_vertical()

Sets vertical orientation.

Item Description
Syntax `separator.orientation_vertical()`
Arguments none
Returns separator object
sep = separator().orientation_vertical();

Example

sep = separator().position(20, 50).size(220, 2).orientation_horizontal();
window().title('Separator').size(280, 120).add(sep).show();

Previous: led

Next: menu