ttk::style(3tk) | Tk Themed Widget | ttk::style(3tk) |
ttk::style - Manipulate style database
ttk::style option ?args?
See also the Tcl'2004 conference presentation, available at http://tktable.sourceforge.net/tile/tile-tcl2004.pdf
Each widget is assigned a style, which specifies the set of elements making up the widget and how they are arranged, along with dynamic and default settings for element options. By default, the style name is the same as the widget's class; this may be overridden by the -style option.
A theme is a collection of elements and styles which controls the overall look and feel of an application.
The ttk::style command takes the following arguments:
A layout specifies a list of elements, each followed by one or more options specifying how to arrange the element. The layout mechanism uses a simplified version of the pack geometry manager: given an initial cavity, each element is allocated a parcel. Then the parcel actually used by the element is adjusted within the allocated parcel. Valid options are:
For example:
ttk::style layout Horizontal.TScrollbar {
Scrollbar.trough -children {
Scrollbar.leftarrow -side left
Scrollbar.rightarrow -side right
Horizontal.Scrollbar.thumb -side left -sticky ew
} }
ttk::intro(3tk), ttk::widget(3tk), photo(3tk), ttk_image(3tk)
style, theme, appearance
8.5 | Tk |