panel = wx.Panel(self, -1)
panel.Bind(wx.EVT_PAINT, self.asd)
framesizer.Add(panel, flag=wx.EXPAND)
回调是 asd 功能。现在我画画
dc = wx.PaintDC(panel)
[...] setting brush and misc
i = 10
for x in range(1, 100):
i = i + x
dc.Clear() # <- Look this... it's correct?
dc.DrawRectangle(i,10,50,50)
答案 0 :(得分:1)
您需要学习的是双缓冲技术。幸运的是,有人已经在wxPython wiki上写了一些关于这个主题的好信息:
您需要查看wx.BufferedPaintDC