diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-04-25 10:45:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-25 10:45:20 (GMT) |
commit | c70f268523cb3213693710e14c0fcae81fd3fa7a (patch) | |
tree | f942967b998bfd03cb7463a4710a8a9a5d2c6cbc | |
parent | fc82f3f8fb36f88a4e7238a463812c2916bd4db0 (diff) | |
download | cpython-c70f268523cb3213693710e14c0fcae81fd3fa7a.zip cpython-c70f268523cb3213693710e14c0fcae81fd3fa7a.tar.gz cpython-c70f268523cb3213693710e14c0fcae81fd3fa7a.tar.bz2 |
bpo-43534: Make dialogs in turtle.textinput() and turtle.numinput() transitient again (GH-24923)
(cherry picked from commit b5adc8a7e5c13d175b4d3e53b37bc61de35b1457)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
-rw-r--r-- | Lib/turtle.py | 5 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Library/2021-03-18-15-46-08.bpo-43534.vPE9Us.rst | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/Lib/turtle.py b/Lib/turtle.py index ba8288d..13f662a 100644 --- a/Lib/turtle.py +++ b/Lib/turtle.py @@ -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 index 0000000..7f2e5a4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-03-18-15-46-08.bpo-43534.vPE9Us.rst @@ -0,0 +1,2 @@ +:func:`turtle.textinput` and :func:`turtle.numinput` create now a transient +window working on behalf of the canvas window. |