Background/foreground on disabled Tkinter.Entry

M

Martyn Quick

If I create a Tkinter.Entry widget, I can adjust the background and the
text colours, using the background and foreground options. However, if
the state is "disabled", then this has no effect and it just appears as
grey on a light grey background. E.g.,

Tkinter.Entry(root, foreground="black", background="white",
state="disabled").grid()

does not do what I expected. What is the correct way to adjust the
foreground and background on disabled Entry widgets?

Thanks,

Martyn
 
F

Fredrik Lundh

Martyn said:
If I create a Tkinter.Entry widget, I can adjust the background and the
text colours, using the background and foreground options. However, if
the state is "disabled", then this has no effect and it just appears as
grey on a light grey background. E.g.,

Tkinter.Entry(root, foreground="black", background="white",
state="disabled").grid()

does not do what I expected. What is the correct way to adjust the
foreground and background on disabled Entry widgets?

tkinter has separate disabledbackground and disableforeground options for
this purpose:

http://www.effbot.org/tkinterbook/entry.htm#Tkinter.Entry.config-method

</F>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top