I have a Canvas that manipulates objects in a mouse event handler. After changing the objects, I want to raise the OnPaint () event for the same Canvas to show (change) the changes. What is the right way to do this? This does not allow me to directly call OnPaint (). Also, triggers an event from another event "wrong" in a sense, or can lead to trouble?
I would just call self.Refresh () or maybe RefreshRect () and pass in the area that needs to be repainted.
self.refresh(), . . , - . , , repaint . , refresh(), , , . , Refresh() .
wxDemo , Paint:
dc = wx.BufferedPaintDC(self, self.buffer, wx.BUFFER_VIRTUAL_AREA)
DC . dc ( ) . , Paint DC, . , DC . .