Skip to content

Modern Tui TuiTextInputStateInit

Paul Squires edited this page Oct 19, 2026 · 6 revisions

Home › Terminal TUI Library › Input Widgets › TuiTextInputStateInit

TuiTextInputStateInit

Sets a text box's state to empty with nothing selected; call it before first use.

Syntax

TuiTextInputStateInit( byref s as TuiTextInputState )

Description

Initialises a state in place -- a SUB, not a function returning one. Call it before first use so selAnchor is -1 rather than 0, which would mean "a selection starting at the beginning".

Example

#import "std/tui"
using tui

dim as TuiTextInputState st
TuiTextInputStateInit( st )
print st.selAnchor                '' -1 -- nothing selected
st.text = "start here"
print st.text

See also

TuiTextInput TuiTextInput.SelectionEnd TuiTextArea TuiCheckbox
TuiTextInputState TuiTextInput.DeleteSelection TuiTextAreaState TuiRadioGroup
TuiTextInput.SelectionStart TuiTextInput.Insert TuiTextAreaStateInit TuiSelect

Library: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Input Widgets
Working examples: hello.tiko · form.tiko · dashboard.tiko


Home · Keyword Index

Clone this wiki locally