Tkinter Help

Chad Netzer cnetzer at mail.arc.nasa.gov
Fri May 2 17:17:17 EDT 2003


On Fri, 2003-05-02 at 13:22, Brian Szmyd wrote:

> frame = MyFrame(root).pack()

Do not create, pack() and assign on the same line.  You are assigning
the result of pack(), which is None, to frame.  So frame is no longer a
frame object after this, which messes the remainder of things up.  Do
this:

frame = MyFrame(root)
frame.pack()

Note that if you then pack() another MyFrame, using your example code,
the window will again resize to be large again.  

You can try using pack_propagate() on the containing frames (root, in
your example), to ask them not to shrink.

-- 

Chad Netzer
(any opinion expressed is my own and not NASA's or my employer's)






More information about the Python-list mailing list