TkinterEP / ttkthemes

A group of themes for the ttk extenstions for Tkinter
GNU General Public License v3.0
364 stars 47 forks source link

Themes not showing except for radiance #65

Closed JoeZiminski closed 4 years ago

JoeZiminski commented 4 years ago

Dear RedFantom,

Thanks a lot for ttkthemes it is a great resource that I am looking forward to using. I am using Python 3.7, tkinter 8.6.9, Windows 10 and have implimented ttkthemes by importing and switching my call to tkinter root:

from ttkthemes import ThemedTk root = ThemedTk(theme="radiance") #ttk.Tk()

This works nicely with 'radiance', but changing to any other theme (i.e. 'blue', 'kroc', 'clearlooks') does not seem to work. If you have any thoughts on this it would be much appreciated and please let me know if you need anymore information.

Akuli commented 4 years ago

What do you mean with "does not seem to work"? What code did you try? Did you get an error message?

JoeZiminski commented 4 years ago

Dear Akuli,

Thanks a lot for your response, apologies for the lack of detail in my initial question. I meant that no formatting appears to take place for any theme other than radiance, with themes such as 'black' looking similar to default (please see attached image). I have also included an example code that captures the main elements from the project I am working on, please let me know if you need anymore information, many thanks.

Images: ttkthemes

Code: ttkthemes_example_code.txt

RedFantom commented 4 years ago

To find the problem, look no further than the import at the top of the file of your example code. It says:

import tkinter as ttk

ttk is actually a submodule in the tkinter package. In order to fix your problem, change the line to:

import tkinter as tk
from tkinter import ttk

And in addition change the ttk.Toplevel (which does not exist) to a tk.Toplevel. Only then will your widgets by actual widgets from the ttk module and thus the themeing be applied as shown in the example images in the documentation.

JoeZiminski commented 4 years ago

Thanks a lot for your help RedFantom, works perfect had has led to some very useful reading on the differences between tk and ttk (of which I previously did not know there was a distinction). Thanks a lot for your help and maintaing this great resource.

RedFantom commented 4 years ago

No problem at all!