On Wed, 19 Jul 2006 06:45:36 -0400
Kent Johnson <[EMAIL PROTECTED]> wrote:

> Joe Cox wrote:
> > I am using Tk and have a series of Radio buttons that I want to bind 
> > to it's own listbox for further selection.
> > I just don't get the point how to click the button and select the 
> > proper listbox I want it tied too.
> Do you mean you want clicking on the radio button to enable a listbox? 
> It sounds like you need to bind an event handler to clicks on the radio 
> button. Can you show us what you have done so far?
> 

Usually a set of Radiobuttons should share one variable, and this sounds like 
they
should also share one command, which might look like:

var = StringVar()
var.set('a')

def radio_command():
    if var.get() == 'a':
        # button with value 'a' selected
        do_this()
    elif var.get() == 'b':
        # button with value 'b' selected
        do_that()
    (etc.)

radio_a = Radiobutton(parent, variable=var, value='a', command=radio_command)
radio_b = Radiobutton(parent, variable=var, value='b', command=radio_command)
(etc.)

I hope this helps

Michael
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to