]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46630: Fix initial focus of IDLE query dialogs (GH-31112)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 3 Feb 2022 22:33:26 +0000 (14:33 -0800)
committerGitHub <noreply@github.com>
Thu, 3 Feb 2022 22:33:26 +0000 (14:33 -0800)
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>
Lib/idlelib/NEWS.txt
Lib/idlelib/query.py
Misc/NEWS.d/next/IDLE/2022-02-03-15-47-53.bpo-46630.tREOjo.rst [new file with mode: 0644]

index 2ba8d581bbc7331c8cd0521ee8c1f4141982a54a..73c8b7a32d7671730a8271c933e06c0a13c37f78 100644 (file)
@@ -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,
index fefa5aac1b7f58a78931339719817d22a4ae35b0..df02f2123ab02f3462ece73259c13e1ba1153be0 100644 (file)
@@ -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',
diff --git a/Misc/NEWS.d/next/IDLE/2022-02-03-15-47-53.bpo-46630.tREOjo.rst b/Misc/NEWS.d/next/IDLE/2022-02-03-15-47-53.bpo-46630.tREOjo.rst
new file mode 100644 (file)
index 0000000..81e3548
--- /dev/null
@@ -0,0 +1 @@
+Make query dialogs on Windows start with a cursor in the entry box.