Tkinter: radiobutton

kiki kiki at pixar.com
Thu Jun 24 06:33:50 CEST 1999


Newbie speaks: I'm sure there's an elegant solution to this, but I just
can't find it, and my head hurts from reading man pages...

I have a color menu that has "Add Color" and "Change Color", and an
appended list of user-created colors as radiobuttons.

What I would like to do is when the user chooses "Change Color", the new
color overwrites the current color selected in the radiobutton list.

The problem is I don't know how to find out which button is selected.
self.color_menu.entryconfig("active"...) configures the "Change Color"
button!!  Arg!  The index is otherwise implicit...

A group of radiobuttons are associated by the fact that they share a
variable.  When that variable changes, the states of the radio buttons
change.  Certainly there must be a way to find out the index of the
selected radiobutton in a group of radiobuttons and modify the contents
[eg "value", "activebackground", etc.] of it...

Thanx, and sorry if this was an obvious question.

Kiki





More information about the Python-list mailing list