from Tkinter import * import tkMessageBox def protocolhandler(): if tkMessageBox.askokcancel("Exit", "Wanna leave?"): if tkMessageBox.askokcancel("Exit", "Are you sure?"): if tkMessageBox.askokcancel("Exit", "Really?"): root.destroy() root = Tk() root.protocol("WM_DELETE_WINDOW", protocolhandler) root.mainloop()