[prev in list] [next in list] [prev in thread] [next in thread]
List: python-list
Subject: askopenfilename() (was: Re: non-blocking getkey?)
From: Ulli Horlacher <framstag () rus ! uni-stuttgart ! de>
Date: 2015-11-28 10:29:55
Message-ID: n3bvn3$k2f$1 () news2 ! informatik ! uni-stuttgart ! de
[Download RAW message or body]
Ulli Horlacher <framstag@rus.uni-stuttgart.de> wrote:
> eryksun <eryksun@gmail.com> wrote:
> > On Thu, Nov 19, 2015 at 10:31 AM, Michael Torrie <torriem@gmail.com> wrote:
> > > One windows it might be possible to use the win32 api to enumerate the
> > > windows, find your console window and switch to it.
> >
> > You can call GetConsoleWindow [1] and then SetForegroundWindow [2].
> (...)
>
> great, this works! Thanks!
One of my Windows test users reports, that the file dialog window of
askopenfilename() starts behind the console window and has no focus.
On Linux (XFCE) I do not have this problem.
I start it with:
Tk().withdraw()
file = askopenfilename(title='select a file',initialdir=HOME)
set_window_focus() # give focus back to console window
Can one force askopenfilename() to start in foreground with focus?
--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mail: horlacher@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/
--
https://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic