Skip to content

Modern Tui TuiFocusRing Current

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

Home › Terminal TUI Library › Widgets › TuiFocusRing.Current

TuiFocusRing.Current

Returns the focused widget, or no value if the ring is empty.

Syntax

TuiFocusRing.Current( ) as Optional( of TuiWidget ptr )

Description

The focused widget, or nothing when the ring is empty. It returns an Optional rather than a null pointer so the empty case has to be handled.

Example

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

dim as TuiCheckbox a
dim as boolean v
a.checked = @v

dim as TuiFocusRing ring
print ring.Current( ).HasValue( ) '' false -- empty ring

ring.Add( @a )
dim as Optional( of TuiWidget ptr ) cur = ring.Current( )
print cur.HasValue( )             '' true
print cur.Value( )->Kind( )       '' Checkbox

See also

TuiWidget TuiWidget.HandleEvent TuiWidget.SetFocused TuiFocusRing.Clear
TuiWidget.Render TuiWidget.SizeHint TuiFocusRing TuiFocusRing.Count
TuiWidget.Kind TuiWidget.CanFocus TuiFocusRing.Add 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