ttk::scrollbar 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::scrollbar .tsris
> .tsris state disabled
> list [.tsris instate disabled] [.tsris instate !disabled]
1 0
% ttk::scrollbar .tsris2
> .tsris2 instate !disabled {list ok}
ok
Errors
% ttk::scrollbar .tsris3; .tsris3 instate
wrong # args: should be ".tsris3 instate state-spec ?script?"
-errorcode NONE
% ttk::scrollbar .tsris4; .tsris4 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