Radiobutton HELP!!

Fredrik Lundh fredrik at pythonware.com
Thu Aug 23 13:58:53 EDT 2001


"Rbtns" 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:
>
> from Tkinter import *
>
> root = Tk()
> root.title('Radio Button Test')
>
> sel1 = -1
> sel2 = -1

you need to use Tkinter variables (which can be traced
by the widgets), not Python variables.

this should work:

    sel1 = IntVar(root); sel1.set(-1)
    sel2 = IntVar(root); sel2.set(-1)

</F>

<!-- (the eff-bot guide to) the python standard library:
http://www.pythonware.com/people/fredrik/librarybook.htm
-->





More information about the Python-list mailing list