[issue24889] Idle: always start with focus

Terry J. Reedy report at bugs.python.org
Tue Aug 18 22:03:11 CEST 2015


New submission from Terry J. Reedy:

On Windows, starting Idle with an icon or at console brings up shell or editor window with focus, ready to receive input. Starting Idle from a built python_d in interactive console mode with '>>> import idlelib.idle' brings up an Idle shell with a cursor blinking at the '>>> ' prompt, but leaves the input focus with the console until one clicks on the Shell window.  This is quite annoying and I want to fix it.

I have the impression that this may be a Windows-only problem.  True?

PyShell.main calls PyShellFileList.open_shell, which calls PyShell.begin. I believe this is the only place .begin is called, and it is only called when there is no existing Shell.

Calling text.focus_force() works for me.  .focus_set does not as the issue is application focus rather than widget focus within Idle.  Does this or might this cause any problems with Linux or Mac?

--
Side note: any comment on this line in the context?
         tkinter._default_root = None # 03Jan04 KBK What's this?

----------
assignee: terry.reedy
components: IDLE
files: idle-focus-fix.diff
keywords: patch
messages: 248790
nosy: markroseman, serhiy.storchaka, terry.reedy
priority: high
severity: normal
stage: commit review
status: open
title: Idle: always start with focus
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40207/idle-focus-fix.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24889>
_______________________________________


More information about the Python-bugs-list mailing list