postscripti coded the demo launcher bars deployed by the last four examples to demonstrate all the different ways that their widgets can be used they were not developed with general-purpose reusability in mindin factthey're not really useful outside the context of introducing widgets in this book that was by designmost tkinter widgets are easy to use once you learn their interfacesand tkinter already provides lots of configuration flexibility by itself but if had it in mind to code checkbutton and radiobutton classes to be reused as general library componentsthey would have to be structured differentlyextra widgets they would not display anything but radio buttons and check buttons as isthe demos each embed state and quit buttons for illustrationbut there really should be just one quit per top-level window geometry management they would allow for different button arrangements and would not pack (or gridthemselves at all in true general-purpose reuse scenarioit' often better to leave component' geometry management up to its caller usage mode limitations they would either have to export complex interfaces to support all possible tkinter configuration options and modesor make some limiting decisions that support one common use only for instancethese buttons can either run callbacks at press time or provide their state later in the application example - shows one way to code check button and radio button bars as library components it encapsulates the notion of associating tkinter variables and imposes common usage mode on callers--state fetches rather than press callbacks--to keep the interface simple example - pp \gui\tour\buttonbars py ""check and radio button bar classes for apps that fetch state laterpass list of optionscall state()variable details automated ""from tkinter import class checkbar(frame)def __init__(selfparent=nonepicks=[]side=leftanchor= )frame __init__(selfparentself vars [for pick in picksvar intvar(chk checkbutton(selftext=pickvariable=varchk pack(side=sideanchor=anchorexpand=yesself vars append(vardef state(self) tkinter tourpart