Tkinter Checkbutton initialization problem
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Tkinter Checkbutton initialization problem

From: Paul Rubin <//phr.cx@NOSPAM.invalid>
Date: Sun Jul 03 2005 - 11:32:21 CEST

Python 2.4, Windows XP. If I say:

    f = Frame()
    f.grid()
    v = IntVar()
    c = Checkbutton(f, text='hi there', variable=v)
    c.grid()
    f.mainloop()

then the checkbutton should initially display as being checked.
But it doesn't. It shows up unchecked, even though v.get() returns 1.
The select operation DOES update the display if there's no variable.

It works properly under Linux with (I think) Python 2.3. I don't have
a 2.4.1 Windows installation to try right now.

Is this a known bug? Is it fixed in 2.4.1? Is there a simple
workaround, that lets me initialize a checkbutton and still be able to
read its state?

Thanks.
Received on Thu Sep 29 16:43:25 2005