Background/foreground on disabled Tkinter.Entry

Discussion in 'Python' started by Martyn Quick, Jan 22, 2006.

  1. Martyn Quick

    Martyn Quick Guest

    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
    Martyn Quick, Jan 22, 2006
    #1
    1. Advertising

  2. Martyn Quick wrote:

    > 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>
    Fredrik Lundh, Jan 22, 2006
    #2
    1. Advertising

  3. Martyn Quick

    Martyn Quick Guest

    Thanks v. much.
    I'd missed that in the documentation I have access to.

    Martyn
    Martyn Quick, Jan 22, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marcel van den Hof
    Replies:
    3
    Views:
    573
    Bruce Barker
    Aug 12, 2005
  2. Replies:
    4
    Views:
    2,407
  3. Luigi Donatello Asero

    Background and foreground colour

    Luigi Donatello Asero, Jul 4, 2004, in forum: HTML
    Replies:
    1
    Views:
    521
    Michael Wilcox
    Jul 4, 2004
  4. Ahmad Hassan

    Changing foreground color on console

    Ahmad Hassan, Nov 6, 2003, in forum: C++
    Replies:
    4
    Views:
    852
    =?iso-8859-1?Q?Juli=E1n?= Albo
    Nov 11, 2003
  5. Replies:
    3
    Views:
    4,650
    Vincent van Beveren
    Jul 26, 2006
Loading...

Share This Page