]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/wxOGL.py
Reduce flicker in the demo when image is dragged out of the frame
[wxWidgets.git] / wxPython / demo / wxOGL.py
index 32b0676cfaf1cac2e2bfc28fbe23e71dd0ceee05..0b2af68b53f367d57ef89b00612b30698fd5a4f3 100644 (file)
@@ -166,11 +166,7 @@ class TestWindow(wxShapeCanvas):
             # for some reason, the shapes have to be moved for the line to show up...
             fromShape.Move(dc, fromShape.GetX(), fromShape.GetY())
 
-##         EVT_PAINT(self, self.OnPaint)
-
-##     def OnPaint(self, evt):
-##         evt.Skip()
-##         print "TheLists:", wxThePenList.GetCount(), wxTheBrushList.GetCount(), wxTheFontList.GetCount()
+            EVT_WINDOW_DESTROY(self, self.OnDestroy)
 
 
     def MyAddShape(self, shape, x, y, pen, brush, text):
@@ -194,7 +190,8 @@ class TestWindow(wxShapeCanvas):
 
 
 
-    def __del__(self):
+    def OnDestroy(self, evt):
+        # Do some cleanup
         for shape in self.diagram.GetShapeList():
             if shape.GetParent() == None:
                 shape.SetCanvas(None)