When doing a long-running operation, the most frequent way to inform a user of progress is through a progress bar.
While running an operation in a thread, we can update a progress bar to show that the operation is moving forward and give the user a hint about the time it might take to complete the work:
The simpledialog.SimpleDialog
widget is used to create simple dialogs with some text and buttons. We are going to leverage it to display a progress bar instead of the buttons:
import tkinter from tkinter import simpledialog from tkinter import ttk from queue import Queue class ProgressDialog(simpledialog.SimpleDialog): def __init__(self, master, text='', title=None, class_=None): super().__init__(master=master, text=text, title=title, class_=class_) self.default = None self.cancel = None self._bar = ttk.Progressbar(self.root, orient="horizontal", length=200...