X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/79609e6f24dbd9382a8351d10d436c6e115bda2e..91fd8ba770eb3b9d9aa5e5143b916af04be3ee65:/wxPython/demo/OGL.py?ds=inline diff --git a/wxPython/demo/OGL.py b/wxPython/demo/OGL.py index af0c047845..f0709c75a9 100644 --- a/wxPython/demo/OGL.py +++ b/wxPython/demo/OGL.py @@ -211,7 +211,8 @@ class MyEvtHandler(ogl.ShapeEvtHandler): if shape.Selected(): shape.Select(False, dc) - canvas.Redraw(dc) + #canvas.Redraw(dc) + canvas.Refresh(False) else: redraw = False shapeList = canvas.GetDiagram().GetShapeList() @@ -230,7 +231,8 @@ class MyEvtHandler(ogl.ShapeEvtHandler): for s in toUnselect: s.Select(False, dc) - canvas.Redraw(dc) + ##canvas.Redraw(dc) + canvas.Refresh(False) self.UpdateStatusBar(shape) @@ -251,9 +253,11 @@ class MyEvtHandler(ogl.ShapeEvtHandler): def OnMovePost(self, dc, x, y, oldX, oldY, display): + shape = self.GetShape() 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()) @@ -334,8 +338,8 @@ class TestWindow(ogl.ShapeCanvas): 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] @@ -418,14 +422,6 @@ Pierre Hj less likely to get rusty because nobody cares about the C++ lib any more. -

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__':