ttk::style map
Gives or sets the values of the options of a style for some states.
ttk::style map STYLE
ttk::style map STYLE OPTION
ttk::style map STYLE OPTION STATEMAP ?OPTION STATEMAP ...?
Description
A STATEMAP is a list of pairs: a state spec and a value. A state spec is a list of state flags, each with an optional !, such as active or {pressed !disabled}. A widget in a state that matches a spec uses the value of that pair in place of the value of configure.
With no OPTION, gives each option of the map and its state map. With one OPTION, gives its state map. With pairs, sets the state maps.
Returns
A list, a state map, or an empty string.
Examples
% ttk::style map Link.TButton -foreground {active blue disabled gray}
> list [ttk::style map Link.TButton -foreground] [ttk::style lookup Link.TButton -foreground disabled]
{active blue disabled gray} gray
Errors
% ttk::style map Bad.TButton -foreground {bogus blue}
Invalid state name bogus
-errorcode NONE
% ttk::style map Bad.TButton -foreground {active}
State map must have an even number of elements
-errorcode NONE
Facts
- Capability
- None.
- Tcl release
- Tcl 9.1 and 8.6.
- Since
- ztk 1.0.0-beta.1