Entry widget -- how to prevent change

Fredrik Lundh fredrik at pythonware.com
Tue Nov 22 12:51:21 EST 2005


"wanwan" <ericwan78 at yahoo.com> wrote:

> let's say I already have some content.  How do I set the widget so user
> cannot change it/?

assuming that you're talking about the Tkinter Entry widget, setting
the state option to "readonly" should do the trick:

    e = Entry(...)
    e.config(state="readonly")

also see

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

</F> 






More information about the Python-list mailing list