example - standardizes behavior--it allows widgets to be configured by subclassing instead of by passing in options in factits hellobutton is true buttonwe can pass in configuration options such as its text as usual when one is made but we can also specify callback handlers by overriding the callback method in subclassesas shown in example - example - pp \gui\intro\gui py from gui import hellobutton class mybutton(hellobutton)subclass hellobutton def callback(self)redefine press-handler method print("ignoring press"if __name__ ='__main__'mybutton(nonetext='hello subclass world'mainloop(this script makes the same windowbut instead of exitingthis mybutton buttonwhen pressedprints to stdout and stays up here is its standard output after being pressed few timesc:\pp \gui\intropython gui py ignoring pressignoring pressignoring pressignoring presswhether it' simpler to customize widgets by subclassing or passing in options is probably matter of taste in this simple example but the larger point to notice is that tk becomes truly object oriented in pythonjust because python is object oriented--we can specialize widget classes using normal class-based and object-oriented techniques in fact this applies to both widget behavior and appearance common appearance for examplealthough we won' study widget configuration options until the next similar customized button class could provide standard look-and-feel different from tkinter' defaults for every instance created from itand approach the notions of "stylesor "themesin some gui toolkitsclass themedbutton(button)config my style too def __init__(selfparent=none**configs)used for each instance button __init__(selfparent**configssee for options self pack(self config(fg='red'bg='black'font=('courier' )relief=raisedbd= themedbutton(text='spam'command=onspamb themedbutton(text='eggs' pack(expand=yesfill=both graphical user interfaces normal button widget objects but same appearance by inheritance