Skip to content

Modern Tui TuiTextInput DeleteSelection

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

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

TuiTextInput.DeleteSelection

Removes the selected text, or does nothing if none is selected.

Syntax

TuiTextInput.DeleteSelection( )

Description

Removes the selected span and puts the cursor where it was. A no-op when nothing is selected.

Example

#import "std/tui"
using tui

dim as TuiTextInputState st
TuiTextInputStateInit( st )
st.text = "hello world"
st.selAnchor = 5 : st.cursor = 11

dim as TuiTextInput box
box.state = @st
box.DeleteSelection( )
print st.text                     '' hello
print st.selAnchor                '' -1 -- the selection is gone too

See also

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