Skip to content

Modern Tui TuiSelect

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

Home › Terminal TUI Library › Input Widgets › TuiSelect

TuiSelect

Draws a dropdown list of options that opens over whatever is below it.

Syntax

type TuiSelect extends TuiWidget
    as TuiStringArray options
    as TuiSelectState ptr state
    as TuiStyle normal, focused_, listStyle, highlightStyle
    as int32 maxVisible
end type

Description

A dropdown. When open it draws OUTSIDE its own area, over whatever is beneath -- that is what a dropdown is, and it uses a frame layer to do it.

Example

#import "std/numeric"
#import "std/tui"
using tui, numeric

dim as TuiSelectState st
dim as TuiSelect s
s.options.Push( "red" ) : s.options.Push( "green" ) : s.options.Push( "blue" )
s.state = @st
s.maxVisible = 5
s.SetFocused( TRUE )

print s.IsOpen( )                 '' false

dim as TuiEvent e
e.kind = TUIEVENT_KEY : e.key.code = TUIKEY_ENTER
s.HandleEvent( e )
print s.IsOpen( )                 '' true -- Enter opens it

See also

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

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