This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients gpolo, serhiy.storchaka
Date 2020-12-22.20:35:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1608669340.97.0.219315442285.issue42721@roundup.psfhosted.org>
In-reply-to
Content
Currently, standard message boxes in tkinter.messagebox (like showinfo() or askyesnocancel()) can be called without master or default root window. If arguments master or parent are not specified and there is no default root window is still created, the root window is created and set as the default root window. It is kept visible after closing a message box. It was done for testing from REPL. It affects also tkinter.colorchooser.askcolor().

The drawback is that the root window is kept visible and that it is set as the default root window (so following explicit calls of Tk(), with possible different arguments does not set the default root window).

Simple query dialogs in tkinter (like askinteger()) initially had the same behavior. But later it was broken, and currently they do not work if master and parent are not specified and the default root window is not set.

Proposed PR improves behavior of message boxes and colorchooser and restore the lost feature for query dialogs. Now if master and parent are not specified and the default root window is not set, the new temporary hidden root window is created, but is not set as the default root window. It will be destroyed right after closing the dialog, so it will not affect other widgets.
History
Date User Action Args
2020-12-22 20:35:41serhiy.storchakasetrecipients: + serhiy.storchaka, gpolo
2020-12-22 20:35:40serhiy.storchakasetmessageid: <1608669340.97.0.219315442285.issue42721@roundup.psfhosted.org>
2020-12-22 20:35:40serhiy.storchakalinkissue42721 messages
2020-12-22 20:35:40serhiy.storchakacreate