Showing alert dialogs
A common use case for dialogs is notifying users of events that occurred in our application, such as that a record has been saved, or that it failed to open a file. We will now take a look at some of the basic functions included in Tkinter to display informational dialogs.
Getting ready
Our program will have three buttons, where each one illustrates a different dialog with a static title and message. This type of dialog boxes have only a button to confirm and close the dialog:

When you run the preceding example, note that each dialog plays the corresponding sound defined by your platform, and the button label is translated to your language:

How to do it...
The three dialogs mentioned in the preceding Getting ready section are opened with the showinfo
, showwarning
, and showerror
functions from thetkinter.messagebox
module:
import tkinter as tk
import tkinter.messagebox as mb
class App(tk.Tk):
def __init__(self):
super().__init__()
btn_info = tk.Button...