This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE: Set query focus to entry box on Windows
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: miss-islington, terry.reedy
Priority: normal Keywords: patch

Created on 2022-02-03 20:37 by terry.reedy, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 31112 merged terry.reedy, 2022-02-03 20:51
PR 31114 merged miss-islington, 2022-02-03 22:06
PR 31115 merged miss-islington, 2022-02-03 22:06
Messages (4)
msg412465 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2022-02-03 20:37
On Mac, and I presume *nix in general, query boxes open with the focus on the first entry box, with the cursor displayed.  One can immediate enter a line number, dotted module name, or whatever. On Windows, since 3.9, one must hit Tab or click on the entry box to set the focus.  If a blank entry is an error, one can even click on OK or hit Enter and the focus will move after an error message.

idlelib/query.py already has self.entry.focus_set.  Why did that stop working in 3.9?  All patches to query.py were before May 2021 and backported to 3.8.  Perhaps the upgrade from tk 8.6.9 to 8.6.12 had an effect given the code as it is.  Text widgets have the same issue and Editor window has 'text.focus_set' in '__init__' and that works.  Whatever, moving entry.focus_set() to just after self.deiconify() works without affecting unittests both in Windows repository and 3.11 installed on macOS.
msg412477 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2022-02-03 22:06
New changeset d1df81a730499cc6286d02afa6028a1e9c22bbbf by Terry Jan Reedy in branch 'main':
bpo-46630: Fix initial focus of IDLE query dialogs (GH-31112)
https://github.com/python/cpython/commit/d1df81a730499cc6286d02afa6028a1e9c22bbbf
msg412479 - (view) Author: miss-islington (miss-islington) Date: 2022-02-03 22:33
New changeset dc315f30f86a1dc7c4607398b379d7c0b55c7549 by Miss Islington (bot) in branch '3.9':
bpo-46630: Fix initial focus of IDLE query dialogs (GH-31112)
https://github.com/python/cpython/commit/dc315f30f86a1dc7c4607398b379d7c0b55c7549
msg412480 - (view) Author: miss-islington (miss-islington) Date: 2022-02-03 22:34
New changeset 4f76b3667d856a13107c65d44d802d0e73c3f104 by Miss Islington (bot) in branch '3.10':
bpo-46630: Fix initial focus of IDLE query dialogs (GH-31112)
https://github.com/python/cpython/commit/4f76b3667d856a13107c65d44d802d0e73c3f104
History
Date User Action Args
2022-04-11 14:59:55adminsetgithub: 90788
2022-02-03 22:43:56terry.reedysetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: + Python 3.9, Python 3.10, Python 3.11
2022-02-03 22:34:09miss-islingtonsetmessages: + msg412480
2022-02-03 22:33:34miss-islingtonsetmessages: + msg412479
2022-02-03 22:06:30miss-islingtonsetpull_requests: + pull_request29297
2022-02-03 22:06:26miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request29296
2022-02-03 22:06:25terry.reedysetmessages: + msg412477
2022-02-03 20:51:35terry.reedysetkeywords: + patch
stage: patch review
pull_requests: + pull_request29295
2022-02-03 20:37:52terry.reedycreate