ttk::labelframe instate
Tests the state flags of the widget, and runs a script when they match.
PATHNAME instate STATESPEC ?SCRIPT?
Description
STATESPEC is a list of flags, each with an optional ! before it. The spec matches when each plain flag is on and each flag with ! is off. With no SCRIPT, gives 1 for a match and 0 for no match. With SCRIPT, runs it at the global level on a match and gives its result, else gives an empty string.
Returns
1 or 0, or the result of SCRIPT.
Examples
% ttk::labelframe .tlfis
> .tlfis state disabled
> list [.tlfis instate disabled] [.tlfis instate !disabled]
1 0
% ttk::labelframe .tlfis2
> .tlfis2 instate !disabled {list ok}
ok
Errors
% ttk::labelframe .tlfis3; .tlfis3 instate
wrong # args: should be ".tlfis3 instate state-spec ?script?"
-errorcode NONE
% ttk::labelframe .tlfis4; .tlfis4 instate bogus
Invalid state name bogus
-errorcode NONE
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztk 1.0.0-beta.1