[Tkinter-discuss] IntVar() not being attached to Checkbutton

Adam Kadzban akadzban at iit.edu
Thu Jun 11 06:41:00 CEST 2009


On Wed, Jun 10, 2009 at 7:16 PM, Guilherme Polo <ggpolo at gmail.com> wrote:

> On Wed, Jun 10, 2009 at 7:51 PM, Adam Kadzban<akadzban at iit.edu> wrote:
> > On Wed, Jun 10, 2009 at 5:42 PM, Adam Kadzban <akadzban at iit.edu> wrote:
> >>
> >>
> >> On Wed, Jun 10, 2009 at 5:08 PM, John McMonagle
> >> <jmcmonagle at velseis.com.au> wrote:
> >>>
> >>> Adam Kadzban wrote:
> >>>
> >>> > I have the main part of the GUI (which has Checkbuttons that behave
> >>> > normally), with a menu option to create another window for some
> >>> > "advanced options".  The code for this window is in its own class,
> >>> > which
> >>> > takes a list of options as parameters and then has some check boxes
> and
> >>> > entry boxes so you can change the option list.  Here's the relevant
> >>> > code:
> >>> >
> >>>
> >>> It's not all that relevant to me.  Try to reduce your problem to the
> >>> minimal code which exhibits the indicated behaviour.
> >>>
> >>> All I can think of, without seeing your offending code, is maybe the
> >>> IntVar or the Checkbutton is being garbage collected somehow.
> >>>
> >>> Regards,
> >>>
> >>> John
> >>
> >>
> >> Stripped down fg.py:  http://pastebin.com/m4c32483e
> >> Stripped down aow.py:  http://pastebin.com/m4ab77b3d
> >>
> >> This still exhibits the behavior for me, is anyone else getting it?
> Also,
> >> just realized this laptop is running Ubuntu 8.10, not 9.04, if that
> makes a
> >> difference.
> >>
> >> -Adam
> >
> > Oddly enough, this works:  http://pastebin.com/m5c9cbc1b
> >
>
> It is not really odd, further explanation was given in the previous
> email. Notice how you create a single interpreter here, and all the
> widgets and variables are bound to the same Tcl interpreter.
>
> > I suppose I could just change all my code to that...
> >
> > -Adam
>
> --
> -- Guilherme H. Polo Goncalves
>


Ah, that makes sense.  I was thinking aow would have to create a new Tk()
instance since it wasn't the same file.  But it makes sense that since it's
still tied back to the original Tk() instance, it would have to be a
Toplevel() instead.  Thanks Guilherme!

-Adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20090610/f7708f27/attachment-0001.htm>


More information about the Tkinter-discuss mailing list