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

Michael Barron barronmo at gmail.com
Wed Feb 20 18:36:13 PST 2008


Thanks for the help; works now.  The resize trick is interesting.  Hopefully
I remember it next time this happens.

Regarding updating the data- is that via .ClearGrid() and then
.SetCellValue() again for each cell?  I'm a little wary of making up my own
table so using CreateGrid() seemed best for me (beginner).

Mike

On Wed, Feb 20, 2008 at 4:31 PM, Robin Dunn <robin at alldunn.com> wrote:

> Michael Barron 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 border like it originally has.
> >
> > Thanks for any help.
>
>      def pushButton(self, event):
>        self.vitalsgrid.Destroy()
>        newvitalsgrid =3D myGrid(self, -1, 3, self.colLabels, self.newvita=
ls)
>        self.vitalsbox.Insert(0, newvitalsgrid, 1, wx.EXPAND|wx.ALL, 20)
>         self.vitalsgrid =3D newvitalsgrid
>         self.Layout()
>
>
> BTW, you'll probably be better off to just update the data in the grid
> rather than destroying it and creating a new one.
>
> --
> Robin Dunn
> Software Craftsman
> http://wxPython.org  Java give you jitters?  Relax with wxPython!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200802=
20/4598bd67/attachment.htm


More information about the wxpython-users mailing list