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]
A number of operations related to themes require that you
have available an instance of the ttk.Style()
class (in the Python sense of class). For example, to
obtain a list of the available themes in your installation:
>>> import ttk >>> s=ttk.Style() >>> s.theme_names() ('clam', 'alt', 'default', 'classic')
The .theme_names()
method returns a tuple
containing the names of the available styles. The 'classic'
theme gives you the original,
pre-ttk appearance.
To determine which theme you get by default, use the
.theme_use()
method with no arguments. To
change the current theme, call this same method with the
desired theme name as the argument:
>>> s.theme_use() 'default' >>> s.theme_use('alt') >>> s.theme_use() 'alt'