]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/OGL.py
Compilo.
[wxWidgets.git] / wxPython / demo / OGL.py
index af0c047845b5dd7d763d6e958737c727c7ff71fb..f0709c75a91973fbba200f3b08f9eaf3b5045f62 100644 (file)
@@ -211,7 +211,8 @@ class MyEvtHandler(ogl.ShapeEvtHandler):
 
         if shape.Selected():
             shape.Select(False, dc)
 
         if shape.Selected():
             shape.Select(False, dc)
-            canvas.Redraw(dc)
+            #canvas.Redraw(dc)
+            canvas.Refresh(False)
         else:
             redraw = False
             shapeList = canvas.GetDiagram().GetShapeList()
         else:
             redraw = False
             shapeList = canvas.GetDiagram().GetShapeList()
@@ -230,7 +231,8 @@ class MyEvtHandler(ogl.ShapeEvtHandler):
                 for s in toUnselect:
                     s.Select(False, dc)
 
                 for s in toUnselect:
                     s.Select(False, dc)
 
-                canvas.Redraw(dc)
+                ##canvas.Redraw(dc)
+                canvas.Refresh(False)
 
         self.UpdateStatusBar(shape)
 
 
         self.UpdateStatusBar(shape)
 
@@ -251,9 +253,11 @@ class MyEvtHandler(ogl.ShapeEvtHandler):
 
 
     def OnMovePost(self, dc, x, y, oldX, oldY, display):
 
 
     def OnMovePost(self, dc, x, y, oldX, oldY, display):
+        shape = self.GetShape()
         ogl.ShapeEvtHandler.OnMovePost(self, dc, x, y, oldX, oldY, display)
         ogl.ShapeEvtHandler.OnMovePost(self, dc, x, y, oldX, oldY, display)
-        self.UpdateStatusBar(self.GetShape())
-
+        self.UpdateStatusBar(shape)
+        if "wxMac" in wx.PlatformInfo:
+            shape.GetCanvas().Refresh(False)
 
     def OnRightClick(self, *dontcare):
         self.log.WriteText("%s\n" % self.GetShape())
 
     def OnRightClick(self, *dontcare):
         self.log.WriteText("%s\n" % self.GetShape())
@@ -334,8 +338,8 @@ class TestWindow(ogl.ShapeCanvas):
         s.SetBitmap(bmp)
         self.MyAddShape(s, 225, 130, None, None, "Bitmap")
 
         s.SetBitmap(bmp)
         self.MyAddShape(s, 225, 130, None, None, "Bitmap")
 
-        dc = wx.ClientDC(self)
-        self.PrepareDC(dc)
+        #dc = wx.ClientDC(self)
+        #self.PrepareDC(dc)
 
         for x in range(len(self.shapes)):
             fromShape = self.shapes[x]
 
         for x in range(len(self.shapes)):
             fromShape = self.shapes[x]
@@ -418,14 +422,6 @@ Pierre Hj
 less likely to get rusty because nobody cares about the C++ lib any
 more.
 
 less likely to get rusty because nobody cares about the C++ lib any
 more.
 
-<p>The Python version should be mostly drop-in compatible with the
-wrapped C++ version, except for the location of the package
-(wx.lib.ogl instead of wx.ogl) and that the base class methods are
-called the normal Python way (superclass.Method(self, ...)) instead of the
-hacky way that had to be done to support overloaded methods with the
-old SWIG (self.base_Method(...))
-
-
 """
 
 if __name__ == '__main__':
 """
 
 if __name__ == '__main__':