You can bind a method to handle wx.EVT_SIZE
or the panel and invalidate it there. Alternatively simply use the wx.FULL_REPAINT_ON_RESIZE
for the panel.
mghie
2010-02-14 05:00:34
You can bind a method to handle wx.EVT_SIZE
or the panel and invalidate it there. Alternatively simply use the wx.FULL_REPAINT_ON_RESIZE
for the panel.
The documentation for a SizeEvent claims that there may be some complications when drawing depends on the dimensions of the window. I do not know exactly what is going on behind the scenes. I followed the suggestion on the link and added the call self.Refresh()
to the top of onPaint()
and this seems to give the desired behavior. See mghie's answer for a more efficient example of working code.