]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43534: Make dialogs in turtle.textinput() and turtle.numinput() transitient again...
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 25 Apr 2021 10:16:49 +0000 (13:16 +0300)
committerGitHub <noreply@github.com>
Sun, 25 Apr 2021 10:16:49 +0000 (13:16 +0300)
Lib/turtle.py
Misc/NEWS.d/next/Library/2021-03-18-15-46-08.bpo-43534.vPE9Us.rst [new file with mode: 0644]

index 81cfcfe8a701441df86842415ef0f604bce3bd9a..11429a62d9477caa51ff60d5a2be5448cb64b224 100644 (file)
@@ -826,7 +826,7 @@ class TurtleScreenBase(object):
         >>> 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):
         """Pop up a dialog window for input of a number.
@@ -847,7 +847,8 @@ class TurtleScreenBase(object):
 
         """
         return simpledialog.askfloat(title, prompt, initialvalue=default,
-                                     minvalue=minval, maxvalue=maxval)
+                                     minvalue=minval, maxvalue=maxval,
+                                     parent=self.cv)
 
 
 ##############################################################################
diff --git a/Misc/NEWS.d/next/Library/2021-03-18-15-46-08.bpo-43534.vPE9Us.rst b/Misc/NEWS.d/next/Library/2021-03-18-15-46-08.bpo-43534.vPE9Us.rst
new file mode 100644 (file)
index 0000000..7f2e5a4
--- /dev/null
@@ -0,0 +1,2 @@
+:func:`turtle.textinput` and :func:`turtle.numinput` create now a transient
+window working on behalf of the canvas window.