Get check box states : CheckBox « GUI Tk « Python






Get check box states

Get check box states

# check buttons, the easy way 

from Tkinter import *      
root = Tk()
states = []                 
for i in range(10):
    var = IntVar()
    chk = Checkbutton(root, text=str(i), variable=var)
    chk.pack(side=LEFT)
    states.append(var)
root.mainloop()                               
print map((lambda var: var.get()), states)    

           
       








Related examples in the same category

1.Check Button Demo: disabledCheck Button Demo: disabled
2.Save check box statesSave check box states
3.A check box buttonA check box button
4.Add a check box to a DialogAdd a check box to a Dialog
5.Check box bar: get selected check boxCheck box bar: get selected check box
6.Border for a group of check boxesBorder for a group of check boxes