Dominic Mayers <[email protected]> added the comment:
Just to add that I realize now that tkinter is designed for applications with a
root window, the "application window". That's why little attention is given to
a possible missing root. In fact, it's interesting that we have this code in
simpledialog.py:
# Here, if parent is None, we have a run time error.
if parent.winfo_viewable():
self.transient(parent)
if title:
self.title(title)
self.parent = parent
self.result = None
body = Frame(self)
self.initial_focus = self.body(body)
body.pack(padx=5, pady=5)
self.buttonbox()
if not self.initial_focus:
self.initial_focus = self
self.protocol("WM_DELETE_WINDOW", self.cancel)
if self.parent is not None:
self.geometry("+%d+%d" % (parent.winfo_rootx()+50,
parent.winfo_rooty()+50))
But, self.parent will never be None. So the geometry always depends on the
parent, which is compatible with the view that we are within an application
with a root window - there is always a parent.
But it contradicts a bit, in my view, the "simple" in "simpledialog". What
about an application with no root window, like git for example, but which,
unlike git, needs to create a simple dialog in some occasions?
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39171>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com