[Tkinter-discuss] Switching focus between different application

corrado clementi corrado.clementi at ciaolab.com
Mon May 31 10:41:02 EDT 2004


Hello

I've two python applications running on a Windows system (either Win2000 or
WinXp); they both use Tkinter as graphical toolkit.
I need to switch the focus between the two, but I'm not able to find a way;
I've tried all the focus_force, grab_set, .. but they all seem to work only
inside a single application.

Is there any way to force the focus to a single application? Or something
like the Alt-Tab to move the focus to the desired application?

I've tried trapping the WM_TAKE_FOCUS protocol, but it does not seem to be
implemented under Windows.

I also tried trapping the keyboard event from one application and send it to
the other, using then an event_generate, but it looks like without the focus
the event is not generated.

Any suggestion is welcome.

Corrado Clementi




More information about the Tkinter-discuss mailing list