Radiobutton HELP!!
Matthew Dixon Cowles
matt at mondoinfo.com
Thu Aug 23 14:46:29 EDT 2001
On Thu, 23 Aug 2001 10:29:46 -0400, Rbtns <rbtns082484 at hotmail.com>
wrote:
>Hi, I'm trying to use Radiobuttons with Tkinter. I've used them
>before, but never two lists of them at one time. The problem I am
>having is that everytime I make a selection in one radiobutton list,
>the program automatically makes that same selection for the other
>list. I have included sample code to illustrate:
Hi!
I think your problem is here:
>sel1 = -1
>sel2 = -1
Tkinter radiobuttons want to work on Tk variables, not Python ones.
Replacing those lines with:
sel1=IntVar()
sel1.set(-1)
sel2=IntVar()
sel2.set(-1)
makes it work as you'd expect. Why it worked at all in the first place
is a mystery to me.
Regards,
Matt
More information about the Python-list
mailing list