beetlebug▾
/

tui::buttontui

Makes a button that runs -command at Return, space, or a click.

tui::button PATH ?-option value ...?

Description

A button takes the focus, which Tab moves; the focused button shows ▶ TEXT ◀. Its options are those of tui::label and -command and -state (normal or disabled). The command PATH has invoke, which runs -command and gives its result.

Returns

PATH.

Examples

% tui::button .b -text Go -command {set ::n 1}; tui::pack .b; tui::focus .b; tui::send Return; set ::n
1

% .b invoke
1

Errors

% tui::button .b
window name "b" already exists in parent
-errorcode TK LOOKUP WINDOW

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::button.

See also