Help in understanding some code!

Fredrik Lundh fredrik at effbot.org
Wed Jan 31 09:49:06 EST 2001


"Wayne" wrote:
> The code that is at the end of this program reads as follows:
>
> # magic to keep a root window from appearing
> L = Label()
> L.tk.call('wm','withdraw', '.')
> del L

that's just a backwards way of saying

    root = Tk()
    root.withdraw()

(tk.call is an internal mechanism used to pass a
command to the Tcl interpreter)

> win = WindowFrame(Toplevel())
> win.wait_window(win)

this pops up a toplevel window (I assume window
frame adds content to it's constructor argument),
and waits for it to disappear again.

Cheers /F





More information about the Python-list mailing list