From the course: Python GUI Development with Tkinter
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Prompting users with the Messagebox and dialogs
From the course: Python GUI Development with Tkinter
Prompting users with the Messagebox and dialogs
- [Instructor] If an error occurs in your program, or the user tries to perform an action, that they're not supposed to. You might want to alert them with a pop-up message about the problem. We've already seen how we can create a new window with the top-level widget to pop up and display information to the user. In this video, we'll look at another way to accomplish that by using the pre-built message box methods to easily create pop-up alerts for the user. We'll also learn how to use the file dialog, and color chooser methods to present the user with familiar selection menus from their operating system. These dialogs and message boxes are not regular Tk widgets. We don't need to create a root widget to assign as their parent, or even import the whole Tkinter package. To use the message box, we only need to import the message box module from the Tkinter package. To do that, we can type from tkinter import message box. Now, that I've imported the message box module, I can create a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Entering and displaying multiple lines with the Text widget11m 31s
-
(Locked)
Adding tags, marks, images, and widgets to the Text widget9m 57s
-
(Locked)
Building a hierarchical treeview7m 19s
-
(Locked)
Adding columns and selecting items in the Treeview7m 12s
-
(Locked)
Building cascading menus11m 5s
-
(Locked)
Drawing a basic line on the Canvas5m 21s
-
(Locked)
Drawing complex shapes on the Canvas9m 58s
-
(Locked)
Attaching a scroll bar to widgets6m 21s
-
(Locked)
Configuring widget styles9m 49s
-
(Locked)
Prompting users with the Messagebox and dialogs6m 11s
-
(Locked)
-
-
-
-