Tk and focusing windows
Matthew Dixon Cowles
matt at mondoinfo.com
Wed Oct 24 19:43:08 CEST 2001
On Wed, 24 Oct 2001 07:16:06 GMT, Graham Ashton <graz at mindless.com>
>I've got an application which opens two Tk windows as soon as it starts
>up; the main window and a progress dialog.
>I want the dialog to be displayed after the main window (so the main
>window can't cover it up), but the way my code is currently structured I
>call mainloop() immediately after creating the dialog. The code for the
>main window is done first.
>The main window is instantiated with "root = Tk()" before anything else
>happens, and the dialog is created with Toplevel().
Tkinter doesn't make it easy to get things displayed attractively
during startup. I find that getting things to look the way I want
often requires figuring out the right places to put calls to
update_idletasks(). I'll append a small example that may help.
Of course, once you've got the right incantation for your window
manager, there's no guarantee that another window manager will do just
the same thing in response to the same requests.
from Tkinter import *
More information about the Python-list