See what happens when some buttons have same value : Radiobutton « Tkinker « Python Tutorial






See what happens when some buttons have same value
from Tkinter import *      
root = Tk()
var = StringVar()
for i in range(10):
    rad = Radiobutton(root, text=str(i), variable=var, value=str(i % 3))
    rad.pack(side=LEFT)
root.mainloop()








18.26.Radiobutton
18.26.1.Radio buttons, the easy wayRadio buttons, the easy way
18.26.2.Hold on to your radio variables (an obscure thing, indeed)Hold on to your radio variables (an obscure thing, indeed)
18.26.3.Deselect for radio buttons simply sets the button's associated value to a null stringDeselect for radio buttons simply sets the button's associated value to a null string
18.26.4.See what happens when some buttons have same valueSee what happens when some buttons have same value
18.26.5.Add RadioButton to a groupAdd RadioButton to a group
18.26.6.Bind variable to RadioButtonBind variable to RadioButton
18.26.7.Radio button barRadio button bar
18.26.8.Use Radio buttons to change the fontUse Radio buttons to change the font