Hi,

Thus spoketh craf <p...@vtr.net> 
unto us on Sun, 12 Dec 2010 20:39:39 -0300:

> Hi.
> 
> Changing the background color ttk.Labelframe control, label does not
> change color.
> 
> CODE:
> 
> from tkinter import *
> from tkinter import ttk
> 
> master = Tk()
> master.geometry('200x200')
> s = ttk.Style()
> s.configure('TLabelframe', background='blue')
> 
> labelframe = ttk.Labelframe(master, text='Options', style='TLabelframe')
> labelframe.pack(fill=BOTH, expand=YES)
> 
> b = ttk.Button(labelframe, text='Hello World')
> b.pack()
> master.mainloop()
> 
> is a Bug?

No ;)
A brief investigation through the default styles delivered with tk
revealed the solution (in vistaTheme.tcl, for those whoa are
interested :). You need to add one line to your example:

s.configure('TLabelframe.Label', background='blue')

I haven't used ttk much yet, but I guess this is the usual way for ttk to
handle the appearance of "subwidgets". Once you've seen this you can
probably get pretty far by trial and error.

Regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

To live is always desirable.
                -- Eleen the Capellan, "Friday's Child", stardate 3498.9
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to