Toogle group Radio Button : RadioButton « GUI Tk « Python






Toogle group Radio Button

Toogle group Radio Button

from Tkinter import *

root = Tk()
root.title('Radiobutton')

cheese=[('Option 1', 1), ('Option 2', 2), ('Option 3', 3),
       ('Option 4', 4), ('Option 5', 5), ('Option 6', 6), ('Option 7', 7)]
var = IntVar()
for text, value in cheese:
    Radiobutton(root, text=text, value=value, variable=var,
                indicatoron=0).pack(anchor=W, fill=X, ipadx=18)
var.set(3)
root.mainloop()


           
       








Related examples in the same category

1.Radio Button DemoRadio Button Demo
2.Radio button in a groupRadio button in a group
3.Radio Button MenuRadio Button Menu
4.Radio button bar: get selected button for a group radio buttonRadio button bar: get selected button for a group radio button
5.Get Radio button stateGet Radio button state
6.Hold on to your radio variables Hold on to your radio variables
7.Save Radio button statesSave Radio button states
8.What happens when some buttons have same valueWhat happens when some buttons have same value