Skip to Content
Tkinter GUI Application Development Blueprints, Second Edition - Second Edition
book

Tkinter GUI Application Development Blueprints, Second Edition - Second Edition

by Bhaskar Chaudhary
March 2018
Beginner to intermediate
422 pages
10h 33m
English
Packt Publishing
Content preview from Tkinter GUI Application Development Blueprints, Second Edition - Second Edition

Adding themes

You may recall that, while defining the Themes menu, we defined a color scheme dictionary containing the name and hexadecimal color codes as a key-value pair, as follows:

color_schemes = {'Default': '#000000.#FFFFFF','Greygarious':'#83406A.#D1D4D1','Aquamarine': '#5B8340.#D1E7E0','Bold Beige': '#4B4620.#FFF0E1','Cobalt Blue':'#ffffBB.#3333aa','Olive Green': '#D1E7E0.#5B8340','Night Mode': '#FFFFFF.#000000',}

The theme choice menu has already been defined. Let's add a callback command to handle the selected menu (2.12.py):

themes_menu.add_radiobutton(label=k, variable=theme_choice, command=change_theme).

Finally, let's define the change_theme function to handle the changing of themes, as follows:

def change_theme(event=None): ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Tkinter GUI Application Development Blueprints

Tkinter GUI Application Development Blueprints

Bhaskar Chaudhary

Publisher Resources

ISBN: 9781788837460Supplemental Content