radiovar.get() seems to work fine for me with the code you provided.=20
You mention .get() but you never say radiovar.get(), so is that what
you meant? Also, radiovar.set(2) works as well for changing the
selection.
- Charlie
On 2/13/06, Martin Weisel <Mar...@gm...> wrote:
> Hi folks,
>
> I figured out how to preselect a Radiobutton in a Tkinter-GUI. One ought =
to
> use .select() instead of .set().
> But now I've come up with another problem: How do I get the actual value =
of
> that Radiobutton? For some reason .get() is returning 0 all the times.
>
> from Tkinter import *
> radio =3D Tk()
>
> radiovar =3D IntVar()
> Yes =3D Radiobutton(radio, text=3D'Yes', value =3D1, variable =3D radiova=
r)
> Yes.pack(side =3D LEFT)
> Yes.select()
> No =3D Radiobutton(radio, text=3D'No', value =3D2, variable =3D radiovar)
> No.pack(side=3DLEFT)
>
> Although .get() does not work, displaying the actual value of radiovar as=
a
> dynamic label on the GUI works very well:
>
> Label(radio, textvariable=3Dradiovar).pack(side =3D RIGHT)
>
> How do I get the actual value of that Radiobutton? In case .get() doesn't
> work at all, is there a way of reading out the textvariable of the Label?
>
> I would appreciate any help.
> Regards,
> Martin
>
>
> --
> DSL-Aktion wegen gro=DFer Nachfrage bis 28.2.2006 verl=E4ngert:
> GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat=
=3D121642
> _______________________________________________
> PyMOL-users mailing list
> PyM...@li...
> https://lists.sourceforge.net/lists/listinfo/pymol-users
>
|