beetlebug▾
/

tui::focustui

Gives or sets the widget that takes the keys.

tui::focus ?PATH?

Description

With no PATH, gives the widget with the focus, or an empty string. Tab and Shift-Tab move the focus among the buttons that are not disabled, in the order of creation.

Returns

The path of the focus, or an empty string.

Examples

% tui::button .a -text A; tui::button .b -text B; tui::pack .a .b; tui::send Tab; tui::focus
.a

Errors

% tui::focus .nope
bad window path name ".nope"
-errorcode TK LOOKUP WINDOW .nope

Facts

Capability
tui. A new interpreter does not have it until the host turns it on.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.7

The full page: tui::focus.

See also