Message260114
Consider the following code implementing a custom modal dialog:
from Tkinter import *
def dialog():
win = Toplevel()
Label(win, text='Modal Dialog').pack()
win.transient(win.master)
win.focus_set()
win.grab_set()
win.wait_window()
root = Tk()
Button(root, text='Custom Dialog', command=dialog).pack()
root.mainloop()
In Python 2.7.3, the parent window behaves as expected when the modal dialog is active. That is, the parent window responds to minimize, maximize, and close events. The modal dialog window iconifies and closes together with the parent window. If a user presses Show Desktop button in Windows OS, the parent and the dialog iconify together and can be restored from the Taskbar.
However, in more recent Python releases (I tested 2.7.8, 2.7.11 and 3.5.1), the parent window does not respond to any of the three window commands. If the modal dialog is open and the user presses Show Desktop, both windows iconify, but they CANNOT be restored or closed from the Taskbar. The only way to close such an application is to kill it through the Task Manager. |
|
Date |
User |
Action |
Args |
2016-02-11 17:05:42 | vs | set | recipients:
+ vs, paul.moore, tim.golden, zach.ware, steve.dower |
2016-02-11 17:05:42 | vs | set | messageid: <1455210342.9.0.230352859774.issue26340@psf.upfronthosting.co.za> |
2016-02-11 17:05:42 | vs | link | issue26340 messages |
2016-02-11 17:05:42 | vs | create | |
|