non-blocking getkey?

Ulli Horlacher framstag at rus.uni-stuttgart.de
Thu Nov 19 10:48:07 EST 2015


Terry Reedy <tjreedy at udel.edu> wrote:
> On 11/18/2015 11:50 AM, Ulli Horlacher wrote:
> > Ulli Horlacher <framstag at rus.uni-stuttgart.de> wrote:
> >
> >>          from Tkinter import Tk
> >>          from tkFileDialog import askopenfilename
> >>
> >>          Tk().withdraw()
> >>          file = askopenfilename()
> >
> > I found another glitch:
> >
> > After termination of askopenfilename() the window focus is not returned to
> > the calling window (xterm on Linux, cmd on Windows). I have to click it
> > again, to regain the focus and continue typing. Is there a workaround?
> 
> What happens with
> 
> root = Tk()
> root.withdraw()
> fiel = ...
> root.destroy()
> 
> Focus cannot stay with destroyed window.

The focus is moved to another, unrelated window, but not back to the
window in which the python scripts run. 
Same behaviour on Linux (XFCE) and windows 7.


-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum IZUS/TIK         E-Mail: horlacher at tik.uni-stuttgart.de
Universitaet Stuttgart         Tel:    ++49-711-68565868
Allmandring 30a                Fax:    ++49-711-682357
70550 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/



More information about the Python-list mailing list