OK Cancel message box : Dialog « Tkinker « Python Tutorial






OK Cancel message box
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()








18.10.Dialog
18.10.1.OK Cancel message boxOK Cancel message box
18.10.2.Color dialog
18.10.3.File dialog
18.10.4.Question dialogQuestion dialog
18.10.5.Error dialogError dialog
18.10.6.Message boxMessage box
18.10.7.Model dialogModel dialog
18.10.8.Popup dialogPopup dialog
18.10.9.A quit button that verifies exit requestsA quit button that verifies exit requests