[Tutor] question

Karim karim.liateni at free.fr
Thu Jan 13 00:43:10 CET 2011



Hello,

"You can even use a StringVar as the checkbutton's variable, and supply 
string values for the
offvalue and onvalue. Here's an example:
self.spamVar = StringVar()
self.spamCB = Checkbutton ( self, text="Spam?",
variable=self.spamVar, onvalue="yes", offvalue="no" )
If this checkbutton is on, self.spamVar.get() will return the string 
"yes"; if the checkbutton
is off, that same call will return the string "no". Furthermore, your 
program can turn the checkbutton
on by calling .set("yes")."

Regards
Karim



On 01/12/2011 05:55 PM, Stinson, Wynn A Civ USAF AFMC 556 SMXS/MXDED wrote:
>
> Can someone give me some sample code to use to determine if a checkbox 
> has been selected using Tkinter? thanks
>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110113/6f1ad1b9/attachment.html>


More information about the Tutor mailing list