Buildin dialogs: warning dialog, info dialog and error dialog : Common Dialog « GUI Tk « Python






Buildin dialogs: warning dialog, info dialog and error dialog

Buildin dialogs: warning dialog, info dialog and error dialog

from Tkinter import *
from tkMessageBox import *

def callback():
    if askyesno('Verify', 'Quit?'):
        showwarning('Yes', 'Quit not yet implemented')
    else:
        showinfo('No', 'Quit has been cancelled')

errmsg = 'Error!'
Button(text='Quit', command=callback).pack(fill=X)
Button(text='Spam', command=(lambda: showerror('Spam', errmsg))).pack(fill=X)
mainloop()

           
       








Related examples in the same category

1.OK cancel dialogOK cancel dialog
2.Question dialogQuestion dialog
3.Error dialogError dialog
4.Entry dialogEntry dialog
5.File open dialogFile open dialog
6.Color chooser dialogColor chooser dialog
7.YES NO CANCEL dialogYES NO CANCEL dialog
8.Set ColorSet Color