[Tkinter-discuss] Correct order for dialog display

Michael Lange klappnase at web.de
Thu Sep 30 18:17:28 CEST 2010


Thus spoketh Bob Greschke <bob at greschke.com> 
unto us on Thu, 30 Sep 2010 11:06:49 -0400:

> The .withdraw() should be right after the statement that creates the
> Toplevel window.  Creating it, then making the call to this def show()
> is giving the system time to make the window visible.  If the Toplevel
> () and the .withdraw() are together the window doesn't show up until
> the .deiconify().

This does actuallly not happen here (with IceWm), unless update_idletasks
() or update() are called somewhere in between, maybe it's Wm dependent
behavior? Anyway, in real world code you are surely right, withdraw()
should be called right after window creation.



.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Too much of anything, even love, isn't necessarily a good thing.
		-- Kirk, "The Trouble with Tribbles", stardate 4525.6

More information about the Tkinter-discuss mailing list