tkinter and focus...

Matthew Dixon Cowles matt at mondoinfo.com
Sun May 27 17:00:36 EDT 2001


On 26 May 2001 12:37:58 GMT, Uwe Schmitt <schmitt at num.uni-sb.de>
wrote:

>in addition to a main window i construc an "informatio-window" using
>Tkinter.Toplevel(). my question is: i'd like to manipulate this
>widnow in order to make it the "active"-window. focus_set() doesnt
>work.

Uwe,
You may find that sending the window focus_force() does what you want.

Assuming that your app is running under Unix, in order to guarantee
that a new window has the focus, you'll need the cooperation of a
possibly-uncooperative window manager. Sending focus_force works on my
laptop (Linux+GNOME) but not on my desktop machine (FreeBSD+wmx). It
seems that not all window managers are prepared to be told by user
programs how to sort out their windows in too much detail.

Regards,
Matt



More information about the Python-list mailing list