[New-bugs-announce] [issue42721] Using of simple dialogs without default root window

Serhiy Storchaka report at bugs.python.org
Tue Dec 22 15:35:40 EST 2020


New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:

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.

----------
components: Tkinter
messages: 383612
nosy: gpolo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Using of simple dialogs without default root window
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42721>
_______________________________________


More information about the New-bugs-announce mailing list