diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-02-03 22:34:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-03 22:34:03 (GMT) |
commit | 4f76b3667d856a13107c65d44d802d0e73c3f104 (patch) | |
tree | 1c1e0ffd3d7455aa9394703fec6121729d3e2582 /Lib/idlelib | |
parent | 63523e7b2a631f28134b25a8063d50e08c741db6 (diff) | |
download | cpython-4f76b3667d856a13107c65d44d802d0e73c3f104.zip cpython-4f76b3667d856a13107c65d44d802d0e73c3f104.tar.gz cpython-4f76b3667d856a13107c65d44d802d0e73c3f104.tar.bz2 |
bpo-46630: Fix initial focus of IDLE query dialogs (GH-31112)
On Windows, one had to Tab or click on the entry box
to get a cursor and be able to enter anything.
(cherry picked from commit d1df81a730499cc6286d02afa6028a1e9c22bbbf)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/NEWS.txt | 3 | ||||
-rw-r--r-- | Lib/idlelib/query.py | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 724709a..e8055a0 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -4,6 +4,9 @@ Released on 2022-05-16 ========================= +bpo-46630: Make query dialogs on Windows start with a cursor in the +entry box. + bpo-46591: Make the IDLE doc URL on the About IDLE dialog clickable. bpo-45296: Clarify close, quit, and exit in IDLE. In the File menu, diff --git a/Lib/idlelib/query.py b/Lib/idlelib/query.py index fefa5aa..df02f21 100644 --- a/Lib/idlelib/query.py +++ b/Lib/idlelib/query.py @@ -83,6 +83,7 @@ class Query(Toplevel): if not _utest: self.deiconify() # Unhide now that geometry set. + self.entry.focus_set() self.wait_window() def create_widgets(self, ok_text='OK'): # Do not replace. @@ -100,7 +101,6 @@ class Query(Toplevel): text=self.message) self.entryvar = StringVar(self, self.text0) self.entry = Entry(frame, width=30, textvariable=self.entryvar) - self.entry.focus_set() self.error_font = Font(name='TkCaptionFont', exists=True, root=self.parent) self.entry_error = Label(frame, text=' ', foreground='red', |