def resize(self, event=None):
"""Handle wx resize events.
Notes:
This method may be called outside the wx event buffer
in order to initialize the panel or reset the drawing
buffer.
"""
size = self.winWidth, self.winHeight = self.GetSize()
if size != self.lastSize: # hack to mitigate multiple consecutive resize events
self.winRadius = min((self.winWidth/2.0, self.winHeight/2.0))
#self.drawingBuffer = wx.Bitmap(self.winWidth, self.winHeight) # wxpython3
self.drawingBuffer = wx.EmptyBitmap(self.winWidth, self.winHeight) # wxpython3
self.lastSize = size
self.refresh()
if event is not None:
event.Skip()
评论列表
文章目录