As with the documentation, it waits until this window is destroyed. It is mainly used for modal pop-ups, although it does not make the mod modal itself. A function call simply does not return until the target window is destroyed. To make a modal window, you also need to capture.
The most common use is to create an instance of Toplevel, populate this window with widgets, and then wait for the window to be fired before performing any other action. While it waits, tkinter can continue to process events as usual.
For example, you can disable (or delay the creation) of the main graphical user interface, open a notification of the terms of service and wait for the user to confirm the terms of service, copyrights, license, etc. After the window is destroyed, you can complete the initialization or enable some widgets, etc.
The standard file dialog box is a great example: you open a dialog box and then your code waits for the user to pick up the file, then it will use the returned file name. Inside the implementation of the dialog, wait_window used wait_window that it does not return until the dialog is rejected.
Bryan oakley
source share