[Tkinter-discuss] Resetting to default background color

Bob Greschke bob at passcal.nmt.edu
Fri Jan 19 17:28:58 CET 2007


I change button colors quite a bit in my programs and I just have a  
line at the beginning like:

    DefClr = Root.cget("bg")

I then just set the background color of whatever I've changed to this  
to return the color to the normal default color.

Bob

On Jan 19, 2007, at 02:14, Vasilis Vlachoudis wrote:

> Dear All,
>
>
>
> How can I reset the background color of widget to the default one?
>
>
>
> Imagine that I create an entry widget with a specific background  
> color i.e. white
>
> e=Entry(root, background=”white”)
>
> e.pack()
>
>>
> and at a later state I want to configure the color to the default  
> system one (equivalent like when I create it: e=Entry(root))
>
> I’ve tried
>
> e[“background”] = “”                    # didn’t work
>
> e[“background”] = None              # nothing
>
> del e[“background”]                    # neither
>
>
>
> Cheers
>
> Vasilis
>
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss



More information about the Tkinter-discuss mailing list