[Tkinter-discuss] pack equivalent of grid_remove(), eg. pack_remove() ?

Michael Lange klappnase at web.de
Thu Dec 9 16:26:16 CET 2010


Thus spoketh python at bdurham.com 
unto us on Thu, 09 Dec 2010 09:48:54 -0500:

> Kevin,
> 
> > No, there isn't. You have to be careful with the packing order for 
> pack_forget() to work--this works best if you limit its use to the last 
> widget group packed. Otherwise, it may be packed in a different 
> location, with surprising results.
> 
> Thanks for that tip! (You're right - I would have been surprised!)
> 
> Is there a best practice way to show/hide specific widgets (or
> containers) in Tkinter?
> 
> Is grid a better layout manager than pack for this type of use case?
> 

Definitely yes, as Kevin pointed out, my convenience class will fail,
too, if there are e.g. multiple frames packed in the same container with
side='left' . Using grid() will save you a lot of headaches which will
compensate the more complex setup of grid() compared to pack().

Regards

Michael


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

It would be illogical to kill without reason.
		-- Spock, "Journey to Babel", stardate 3842.4


More information about the Tkinter-discuss mailing list