Skip to content

Commit b5adc8a

Browse files
bpo-43534: Make dialogs in turtle.textinput() and turtle.numinput() transitient again (GH-24923)
1 parent 3bb3fb3 commit b5adc8a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Lib/turtle.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ def textinput(self, title, prompt):
826826
>>> screen.textinput("NIM", "Name of first player:")
827827
828828
"""
829-
return simpledialog.askstring(title, prompt)
829+
return simpledialog.askstring(title, prompt, parent=self.cv)
830830

831831
def numinput(self, title, prompt, default=None, minval=None, maxval=None):
832832
"""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):
847847
848848
"""
849849
return simpledialog.askfloat(title, prompt, initialvalue=default,
850-
minvalue=minval, maxvalue=maxval)
850+
minvalue=minval, maxvalue=maxval,
851+
parent=self.cv)
851852

852853

853854
##############################################################################
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
:func:`turtle.textinput` and :func:`turtle.numinput` create now a transient
2+
window working on behalf of the canvas window.

0 commit comments

Comments
 (0)