bpo-43534: Make dialogs in turtle.textinput() and turtle.numinput() transitient again (GH-24923)

(cherry picked from commit b5adc8a7e5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-04-25 03:44:30 -07:00 committed by GitHub
parent d962b00fcf
commit 7248ce30bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -826,7 +826,7 @@ def textinput(self, title, prompt):
>>> screen.textinput("NIM", "Name of first player:") >>> screen.textinput("NIM", "Name of first player:")
""" """
return simpledialog.askstring(title, prompt) return simpledialog.askstring(title, prompt, parent=self.cv)
def numinput(self, title, prompt, default=None, minval=None, maxval=None): def numinput(self, title, prompt, default=None, minval=None, maxval=None):
"""Pop up a dialog window for input of a number. """Pop up a dialog window for input of a number.
@ -847,7 +847,8 @@ def numinput(self, title, prompt, default=None, minval=None, maxval=None):
""" """
return simpledialog.askfloat(title, prompt, initialvalue=default, return simpledialog.askfloat(title, prompt, initialvalue=default,
minvalue=minval, maxvalue=maxval) minvalue=minval, maxvalue=maxval,
parent=self.cv)
############################################################################## ##############################################################################

View File

@ -0,0 +1,2 @@
:func:`turtle.textinput` and :func:`turtle.numinput` create now a transient
window working on behalf of the canvas window.