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

Robin Dunn robin at alldunn.com
Wed Feb 20 14:31:35 PST 2008


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 = myGrid(self, -1, 3, self.colLabels, self.newvitals)
	self.vitalsbox.Insert(0, newvitalsgrid, 1, wx.EXPAND|wx.ALL, 20)
         self.vitalsgrid = 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!





More information about the wxpython-users mailing list