+ def OnSize(self, event):
+ """
+ Called when the window is resized. We set a flag so the idle
+ handler will resize the buffer.
+ """
+ self.reInitBuffer = true
+
+
+ def OnIdle(self, event):
+ """
+ If the size was changed then resize the bitmap used for double
+ buffering to match the window size. We do it in Idle time so
+ there is only one refresh after resizing is done, not lots while
+ it is happening.
+ """
+ if self.reInitBuffer:
+ self.InitBuffer()
+ self.Refresh(FALSE)
+
+