New Tkinter windows don't get focus on OS X

eb303 eric.brunel at pragmadev.com
Fri Sep 11 03:53:56 EDT 2009


On Sep 11, 9:14 am, Hendrik van Rooyen <hend... at microcorp.co.za>
wrote:
> On Thursday 10 September 2009 18:19:09 Joshua Bronson wrote:
>
> > True, but it'll still be a lot less painful for me to test my app if I
> > can get it to steal focus
> > when launched from the command line. If anyone knows how to do this in
> > Tkinter, help would be much appreciated.
>
> look for widget.focus_force()
> and look for widget.grab_set_global()

Doesn't work. BTW, forcing the focus or setting the grab globally are
usually considered very annoying and I don't know any windowing system
or window manager honouring those.

For the OP: the problem comes from the tcl/tk level. Running a tcl
script just opening a window from the terminal shows the same
behaviour. You might want to forward the question to the tcl guys.



More information about the Python-list mailing list