save coding time and provide nice native look-and-feel "smartand reusable quit button let' put some of these canned dialogs to better use example - implements an attachable quit button that uses standard dialogs to verify the quit request because it' classit can be attached and reused in any application that needs verifying quit button because it uses standard dialogsit looks as it should on each gui platform example - pp \gui\tour\quitter py "" quit button that verifies exit requeststo reuseattach an instance to other guisand re-pack as desired ""from tkinter import from tkinter messagebox import askokcancel get widget classes get canned std dialog class quitter(frame)subclass our gui def __init__(selfparent=none)constructor method frame __init__(selfparentself pack(widget button(selftext='quit'command=self quitwidget pack(side=leftexpand=yesfill=bothdef quit(self)ans askokcancel('verify exit'"really quit?"if ansframe quit(selfif __name__ ='__main__'quitter(mainloop(this module is mostly meant to be used elsewherebut it puts up the button it implements when run standalone figure - shows the quit button itself in the upper leftand the askokcancel verification dialog that pops up when quit is pressed figure - quitterwith askokcancel dialog dialogs