Skip to content

Modern Tui TuiTextInput Insert

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

Home › Terminal TUI Library › Input Widgets › TuiTextInput.Insert

TuiTextInput.Insert

Inserts text at the cursor, replacing any selection first.

Syntax

TuiTextInput.Insert( byref t as ustring )

Description

Inserts text at the cursor, replacing any selection first. This is what a paste event calls, and what typing calls one character at a time.

Example

#import "std/tui"
using tui

dim as TuiTextInputState st
TuiTextInputStateInit( st )
st.text = "hell"
st.cursor = 4

dim as TuiTextInput box
box.state = @st
box.Insert( "o there" )
print st.text                     '' hello there
print st.cursor                   '' 11 -- it moved with the text

See also

TuiTextInput TuiTextInput.SelectionStart TuiTextArea TuiCheckbox
TuiTextInputState TuiTextInput.SelectionEnd TuiTextAreaState TuiRadioGroup
TuiTextInputStateInit TuiTextInput.DeleteSelection 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