sizer.Layout() vs. panel.Layout()

Michael Hipp michael at hipp.com
Sat Jun 3 08:56:36 PDT 2006


More sizer fun, trying to understand "the why".

I've a horrid panel with 40-something controls on it. It's packed tight.

So I have a StaticText control, that I stuff a new (longish) value into. If I call panel.Layout() a bunch of things spill off the right of the screen, but yet there's obviously plenty of room for things to resize without that. If I call sizer.Layout() everything looks great.

I thought panel.Layout() was supposed to call Layout() on all it's children and it's official sizer and everything would propagate down to all the controls and sizers. Is this not true?

Is calling Layout() on the sizers and not the panel the "correct" answer? Or always call it on both?

I love my children. They're the best kids around. But sometimes they're a pain. Same with sizers. ;-)

Michael




More information about the wxpython-users mailing list