+ def Cleanup(self, evt):
+ if hasattr(self, "menu"):
+ self.menu.Destroy()
+ del self.menu
+
+
+ def InitBuffer(self):
+ """Initialize the bitmap used for buffering the display."""
+ size = self.GetClientSize()
+ self.buffer = wx.EmptyBitmap(max(1,size.width), max(1,size.height))
+ dc = wx.BufferedDC(None, self.buffer)
+ dc.SetBackground(wx.Brush(self.GetBackgroundColour()))
+ dc.Clear()
+ self.DrawLines(dc)
+ self.reInitBuffer = False