This is an unofficial mirror of Tkinter reference documentation (based on Python 2.7 and Tk 8.5) created by the late John Shipman.
It was last updated in 2013 and is unmaintained.[More info]
Tkinter 8.5 reference: a GUI for Python | ![]() |
Designing withttk widgets involves three levels of abstraction:
Atheme is a complete “look and feel,” customizing the appearance of all the widgets.
Astyle is the description of the appearance of one kind of widget. Each theme comes with a predefined set of styles, but you can customize the built-in styles or create your own new styles.
The phrase “kind of widget” in the previous paragraph technically refers to the “class” of a widget. However, in thettk world, this is different from Python classes. Withinttk, the class of a widget is a character string. For example, thettk class of a stockButton
widget is the string'TButton'
.
Each style is composed of one or moreelements. For example, the style of a typical button has four elements: a border around the outside; a focus element that changes color when the widget has inputfocus; a padding element; and the button's label (text, image, or both).
We will discuss the discovery, use and customization of each of these layers in separate sections.