Bizarre Tkinter radio button behaviour

Fredrik Lundh fredrik at pythonware.com
Thu Jul 8 04:02:18 EDT 1999


Greg Ewing <greg.ewing at compaq.com> wrote:
> I have some sets of radio buttons linked to
> Tkinter variables. I set the initial values of
> the variables, expecting the corresponding 
> buttons to come up selected when the window
> first appears.
> 
> But it doesn't happen.
> 
> I mess around trying different things. I
> add a command to one of the radio buttons to
> print out the values of the variables when
> they change. All of a sudden the buttons
> start appearing with default selections.
> 
> Great, I think, and take out my debugging code...
> and they stop working again!
> 
> After some more trial and error I find that
> if *one* of the radio buttons has a command
> attached -- even just an empty procedure --
> then *all* of the default buttons come up
> properly selected. Otherwise, none of them
> do.

sure sounds like a reference counting problem.
but if you want to know exactly what happens,
I think you have to post some code...

</F>





More information about the Python-list mailing list