Table of Contents

textedit

`textedit()` creates a text editor. It can be single-line, multi-line, or automatic style.

Constructor

textedit()

Creates a text edit object.

edit = textedit().style_multi().text("Line 1");

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
`text(value)` self Sets current text.
`ghost(value)` self Sets placeholder/ghost text.
`readonly(enabled)` self Enables or disables read-only mode.
`style_single()` self Uses single-line editing style.
`style_multi()` self Uses multi-line editing style.
`style_auto()` self Uses automatic style.
`on_change(callback)` self Sets callback called when text changes.

Example

edit = textedit().position(20, 20).size(260, 120).style_multi().text("Notes");
window().title("Text Edit").size(320, 180).add(edit).show();

Previous: textinput

Next: numinput