radiovar.get() seems to work fine for me with the code you provided. 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 <martin.wei...@gmx.de> 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 = Tk() > > radiovar = IntVar() > Yes = Radiobutton(radio, text='Yes', value =1, variable = radiovar) > Yes.pack(side = LEFT) > Yes.select() > No = Radiobutton(radio, text='No', value =2, variable = radiovar) > No.pack(side=LEFT) > > Although .get() does not work, displaying the actual value of radiovar as a > dynamic label on the GUI works very well: > > Label(radio, textvariable=radiovar).pack(side = 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ßer Nachfrage bis 28.2.2006 verlängert: > 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 files > 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=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > PyMOL-users mailing list > PyMOL-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pymol-users >