Expanding the size of wx Frame

kyosohma at gmail.com kyosohma at gmail.com
Fri Nov 9 17:24:15 CET 2007


On Nov 8, 11:02 pm, sundarvenkata <sundarvenk... at gmail.com> wrote:
> hello all, is there a way to make wxpython frame to expand itself
>            as we add controls to it

Yes. I recommend using sizers. Then you can have the frame fit the
widgets it holds using the Fit() command. I think this only applies
when you first create the frame. After that the usual way is to call
Layout() or Refresh() on the parent of the widgets (the frame in this
case).

I've done something like this before when I've changed elements in my
panel:

self.SetClientSize(self.panel.GetBestSize())

You might also find the wx.CollapsiblePane valuable.

Mike




More information about the Python-list mailing list