I am new in Python and I want to use protocols like WM_DELETE_WINDOW, WM_TAKE_FOCUS and WM_SAVE_YOURSELF. I have found an example of WM_DELETE_WINDOW which is clear enough to understand. But I want to understand the rest two protocols. What do they do? from Tkinter import * import tkMessageBox root = Tk() def on_closing(): if tkMessageBox.askokcancel("Quit", "Do you want to quit?"): root.destroy() root.protocol("WM_DELETE_WINDOW", on_closing) root.mainloop() Continue reading...