Hello,
according to the book "wxPython in action", i can repaint my wx.grid by
using forceRefresh() after changes in the wx.gridtablebase class. But
actually this has no effect at all (at least i can't see one).
so i tried to delete the grid and rebuild it:
After changing the tablebase, and forcerefresh() does not word:
def updategrid(self):
self.gridsizer.Detach(self.grid)
del self.grid
self.grid=InferenceGrid(self.gridpanel,self.mymodel,self.inf)
self.gridsizer.Add(self.grid,0,wx.ALL,20)
self.gridsizer.Layout()
This way creates a new grid, but it is shown on top of the old one (the
new one is smaller). What am I doing wrong??
I actually have the same problem, when I resize a wx.Image. When I close
the window and open it again it is shown correctly.
So how can I repaint a panel or a grid entirely? (Refresh() has no
effect either)
Hello,
according to the book "wxPython in action", i can repaint my wx.grid by
using forceRefresh() after changes in the wx.gridtablebase class. But
actually this has no effect at all (at least i can't see one).
so i tried to delete the grid and rebuild it: After changing the tablebase, and forcerefresh() does not word:
def updategrid(self):
self.gridsizer.Detach(self.grid)
del self.grid
self.grid=InferenceGrid(self.gridpanel,self.mymodel,self.inf)
self.gridsizer.Add(self.grid,0,wx.ALL,20)
self.gridsizer.Layout()
This way creates a new grid, but it is shown on top of the old one (the
new one is smaller). What am I doing wrong?? I actually have the same problem, when I resize a wx.Image. When I close
the window and open it again it is shown correctly. So how can I repaint a panel or a grid entirely? (Refresh() has no
effect either)
Thanks, Jakob
Platform and wx version? Does it repaint if you manually resize the frame or drag another window across your application? If so, then you'll just want to call Layout() or Refresh() on the grid's parent...
Platform and wx version? Does it repaint if you manually resize the
frame or drag another window across your application? If so, then you'll
just want to call Layout() or Refresh() on the grid's parent...
-------------------
Mike Driscoll
Linux Ubuntu intrepid, wx-version 2.8.9.2.
Thanks for the answer. It does not repaint at all. Not on loosing fokus, not on resizing or when in drag another window over it.
The grid is on a wx.FlatNotebook. Only if I close the specific page and open it again, the grid is repainted.
Platform and wx version? Does it repaint if you manually resize the frame or drag another window across your application? If so, then you'll just want to call Layout() or Refresh() on the grid's parent...
-------------------
Mike Driscoll
Linux Ubuntu intrepid, wx-version 2.8.9.2.
Thanks for the answer. It does not repaint at all. Not on loosing fokus, not on resizing or when in drag another window over it. The grid is on a wx.FlatNotebook. Only if I close the specific page and open it again, the grid is repainted.
Jakob
Hmmm...that's one of Andrea's widgets. I haven't messed with it, so I don't know if it is the issue or not. One simple way to find out would be to replace it with a wx.Notebook and see if it works in there. If so, then we'll have to bug Andrea.
Linux Ubuntu intrepid, wx-version 2.8.9.2.
Thanks for the answer. It does not repaint at all. Not on loosing fokus,
not on resizing or when in drag another window over it. The grid is on a
wx.FlatNotebook. Only if I close the specific page and open it again, the
grid is repainted.
Jakob
Hmmm...that's one of Andrea's widgets. I haven't messed with it, so I don't
know if it is the issue or not. One simple way to find out would be to
replace it with a wx.Notebook and see if it works in there. If so, then
we'll have to bug Andrea.
I am not sure if the repainting problem is due to FlatNotebook or not:
in any case, it would be nice to have a small example to play with:
Hello,
according to the book "wxPython in action", i can repaint my wx.grid by
using forceRefresh() after changes in the wx.gridtablebase class. But
actually this has no effect at all (at least i can't see one).
As others have mentioned we will need a small runnable sample that shows the problem in order to diagnose it. As far as I know the only time that ForceRefresh would not have any effect is if there is an unbalanced set of BeginBatch/EndBatch calls and so batch mode is still active.
so i tried to delete the grid and rebuild it: After changing the tablebase, and forcerefresh() does not word:
def updategrid(self):
self.gridsizer.Detach(self.grid)
del self.grid
self.grid=InferenceGrid(self.gridpanel,self.mymodel,self.inf)
self.gridsizer.Add(self.grid,0,wx.ALL,20)
self.gridsizer.Layout()
This way creates a new grid, but it is shown on top of the old one (the
new one is smaller). What am I doing wrong??
This has nothing to do with your original problem, but "del self.grid" does not destroy the widget, just the Python proxy object. To destroy the widget you need to call it's Destroy() method.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
i will try to create a simple application describing the problem. Since
I am really busy right now, it will take a few days. Thank you anyway.
Thank you, Jakob
···
Am Montag, den 23.03.2009, 12:18 -0700 schrieb Robin Dunn:
jakob fischer wrote:
> Hello,
> according to the book "wxPython in action", i can repaint my wx.grid by
> using forceRefresh() after changes in the wx.gridtablebase class. But
> actually this has no effect at all (at least i can't see one).
As others have mentioned we will need a small runnable sample that shows
the problem in order to diagnose it. As far as I know the only time
that ForceRefresh would not have any effect is if there is an unbalanced
set of BeginBatch/EndBatch calls and so batch mode is still active.
>
> so i tried to delete the grid and rebuild it:
> After changing the tablebase, and forcerefresh() does not word:
>
> def updategrid(self):
> self.gridsizer.Detach(self.grid)
> del self.grid
> self.grid=InferenceGrid(self.gridpanel,self.mymodel,self.inf)
> self.gridsizer.Add(self.grid,0,wx.ALL,20)
> self.gridsizer.Layout()
>
> This way creates a new grid, but it is shown on top of the old one (the
> new one is smaller). What am I doing wrong??
This has nothing to do with your original problem, but "del self.grid"
does not destroy the widget, just the Python proxy object. To destroy
the widget you need to call it's Destroy() method.