beetlebug▾
/

ttk::button invoke

Runs the command of the button, as a click does.

PATHNAME invoke

Description

Runs the -command script of the button at the global level and gives its result. A button with the state flag disabled runs no script and gives an empty string. An error of the script is the error of invoke. The command runs also with no window on the screen, so a test can drive a button with invoke.

Returns

The result of the -command script, or an empty string.

Examples

% ttk::button .tbiv -command {list a b}
> .tbiv invoke
a b

% ttk::button .tbiv2 -command {list a b}
> .tbiv2 state disabled
> .tbiv2 invoke

Errors

% ttk::button .tbiv3; .tbiv3 invoke x
wrong # args: should be ".tbiv3 invoke"
-errorcode TCL WRONGARGS

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1

See also