Theme support

As we saw in Chapter 8, Improving the Look with Styles and Themes, Ttk provides a number of themes which differ from platform to platform. Each platform contains an alias called "default", which points to the most sensible theme for that platform.

Attempting to set a theme that doesn't exist results in an exception, so avoid hardcoding a theme setting in your application, and make sure theme choices are checked against the output of Style.theme_names() .

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.