1import tkinter as tk
2from tkinter import messagebox as mb
3
4def answer():
5 mb.showerror("Answer", "Sorry, no answer available")
6
7def callback():
8 if mb.askyesno('Verify', 'Really quit?'):
9 mb.showwarning('Yes', 'Not yet implemented')
10 else:
11 mb.showinfo('No', 'Quit has been cancelled')
12
13tk.Button(text='Quit', command=callback).pack(fill=tk.X)
14tk.Button(text='Answer', command=answer).pack(fill=tk.X)
15tk.mainloop()
16