Skip to content

Modern Tui TuiMessageBox Accepted

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

Home › Terminal TUI Library › Overlays and Chrome › TuiMessageBox.Accepted

TuiMessageBox.Accepted

Returns true once Enter was pressed on a button; selected says which.

Syntax

TuiMessageBox.Accepted( ) as boolean

Description

True once Enter was pressed on a button. Read selected to find out WHICH.

Example

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

dim as TuiMessageBox mb
mb.buttons.Push( "OK" ) : mb.buttons.Push( "Cancel" )
mb.selected = 1

dim as TuiEvent e
e.kind = TUIEVENT_KEY : e.key.code = TUIKEY_ENTER
mb.HandleEvent( e )
print mb.Accepted( ), mb.selected      '' true 1 -- they chose Cancel

See also

TuiPopup TuiMenu TuiStatusItem TuiStatusBar.Add
TuiMessageBox TuiMenuBar TuiStatusItemOf TuiTreeNode
TuiMessageBox.Cancelled TuiMenuBar.IsOpen TuiStatusBar TuiTreeState

Library: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Overlays and Chrome
Working examples: hello.tiko · form.tiko · dashboard.tiko


Home · Keyword Index

Clone this wiki locally