ttk styles

Ethan Furman ethan at stoneleaf.us
Thu Mar 17 19:24:02 EDT 2011


Peter wrote:
> Thanks for the link Malcolm, I'll have a look at it. What is
> particularly interesting (at first glance), is that the author has
> "mixed" Tkinter with ttk as it suited i.e. look at this line:
> 
> f1 = tkinter.Frame(nb, background="red")
> 
> If ttk was being used purely (from tkinter import *; from ttk import
> *) then the "background" keyword is nolonger available/recognised and
> the code would have to use ttk styles to change the colour - I find it
> somewhat disappointing that the author felt this approach was
> necessary as it tends to dilute the example by not keeping everything
> purely ttk - modifying the style to change the background of the Frame
> statements would have made it an even better example!
> 
> I will repost the answer if I can work it out using this example code
> - thanks again! :-)

Another place to look for inspiration is http://tkdocs.com/

One thing to keep in mind is that not all widgets in tkinter have been 
migrated to ttk (although Frame was).

~Ethan~



More information about the Python-list mailing list