Skip to content

Modern Tui TuiWidget SetFocused

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

Home › Terminal TUI Library › Widgets › TuiWidget.SetFocused

TuiWidget.SetFocused

Tells the widget whether it has focus; the focus ring calls it for you.

Syntax

TuiWidget.SetFocused( byval on_ as boolean )

Description

Tells the widget it does or does not have focus. TuiFocusRing calls this for you -- you would call it directly only when managing focus yourself.

Example

#import "std/tui"
using tui

dim as TuiCheckbox c
dim as boolean v
c.checked = @v
c.SetFocused( TRUE )

'' a focused widget must LOOK focused: give it a distinct style, or the
'' focus is invisible and the application appears broken
dim as TuiTheme th = TuiThemeDefault( )
c.normal = th.normal
c.focused_ = th.selected
print c.focused_.Equals( c.normal )        '' false -- as it must be

See also

TuiWidget TuiWidget.HandleEvent TuiFocusRing TuiFocusRing.Count
TuiWidget.Render TuiWidget.SizeHint TuiFocusRing.Add TuiFocusRing.Current
TuiWidget.Kind TuiWidget.CanFocus TuiFocusRing.Clear TuiFocusRing.Next_

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


Home · Keyword Index

Clone this wiki locally