quitter(frmpack(fill=xif __name__ ='__main__'demo(mainloop(in terms of program codecheck buttons resemble normal buttonsthey are even packed within container widget operationallythoughthey are bit different as you can probably tell from this figure (and can better tell by running this live) check button works as toggle--pressing one changes its state from off to on (from deselected to selected)or from on to off again when check button is selectedit has checked displayand its associated intvar variable has value of when deselectedits display is empty and its intvar has value of to simulate an enclosing applicationthe state button in this display triggers the script' report method to display the current values of all five toggles on the stdout stream here is the output after few clicksc:\pp \gui\tourpython democheck py reallythese are the values of the five tkinter variables associated with the checkbuttons with variable optionsbut they give the buttonsvalues when queried this script associates intvar variables with each checkbutton in this displaysince they are or binary indicators stringvars will work heretooalthough their get methods would return strings ' or ' (not integersand their initial state would be an empty string (not the integer this widget' command option lets you register callback to be run each time the button is pressed to illustratethis script registers standard dialog demo call as handler for each of the checkbuttons--pressing button changes the toggle' state but also pops up one of the dialog windows we visited earlier in this tour (regardless of its new stateinterestinglyyou can sometimes run the report method interactivelytoo--when working as follows in shell windowwidgets pop up as lines are typed and are fully activeeven without calling mainloop (though this may not work in some interfaces like idle if you must call mainloop to display your gui) :\pp \gui\tourpython from democheck import demo demo( report( report( report( checkbuttonradiobuttonand scale