Tkinter Checkbutton initialization problem

Paul Rubin http
Sun Jul 3 05:32:21 EDT 2005


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.



More information about the Python-list mailing list