Tkinter: why does an empty frame not shrink?

Greg McFarlane gregm at
Fri Jun 25 08:29:38 CEST 1999

If you have several child widgets packed in a frame and you unpack the
children one by one, the frame will gradually get smaller, except when
the last child is unpacked, in which case the frame does not resize. 
Does anyone know why the frame does not shrink to 0x0 when you unpack
the last child?  Any soluton?

Example script:
import Tkinter

root = Tkinter.Tk()

frame = Tkinter.Frame(background = 'red')
frame.pack(fill = 'x')

for i in range(5):
    button = Tkinter.Button(frame, text = 'Unpack me')
    button.configure(command = button.pack_forget)


Greg McFarlane:    INMS Telstra Australia (gregm at
Today's forecast:  Sunny, with occasional cloudy periods and a chance
		   of precipitation in some areas.

More information about the Python-list mailing list