def refresh(self):
"""Refresh the drawing area after a change has been made.
This method sets up a drawing context, calls self.draw
to update the drawing and then calls self.triggerRepaint
in order to update the drawing area on the screen.
This method should be called each time a change is
made that requires the drawing area to be updated.
"""
dc = wx.MemoryDC(self.drawingBuffer)
dc.SelectObject(self.drawingBuffer)
dc.SetBackground(wx.Brush(self.background, style=wx.SOLID))
dc.Clear()
# do not draw if window is very small, right solution? XXX - idfah
if self.winRadius < 1.0e-3:
return
#dc.BeginDrawing()
self.draw(dc)
#dc.EndDrawing()
#del dc
dc.SelectObject(wx.NullBitmap)
self.triggerRepaint()
评论列表
文章目录