[wxPython-users] Can't get grid back into sizer

C M cmpython at gmail.com
Wed Feb 20 14:21:34 PST 2008


On Wed, Feb 20, 2008 at 3:31 PM, Michael Barron <barronmo at gmail.com> wrote:

> I have included a small example file that shows the problem I'm having.  I
> have a grid with data and a button that 'refreshes' the grid to show the =
new
> data.  I can't seem to get the grid back into the sizer with the 20p bord=
er
> like it originally has.
>
> Thanks for any help.
>
> Mike
>

Classic lack of Layout() problem.  Uncomment the line you have commented,
and try it again but then drag the corner of the frame to make it
larger--works now, right?  So to fix it, just add self.Layout() after adding
it to the sizer in your button handler.  The "does a resize fix it?" test is
a quick one I use to spot these things.

Also, you shouldn't put things right onto the frame.  Put a panel first, and
put your controls on the panel.  (then you would call self.panel.Layout() in
the above).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200802=
20/f6215507/attachment.htm


More information about the wxpython-users mailing list