X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/41378d3480c2b4fe70c052b89084c7ec59c7ed1e..864a91c827740da5e8a3e1f36feaf396d34dedc0:/wxPython/demo/GLCanvas.py diff --git a/wxPython/demo/GLCanvas.py b/wxPython/demo/GLCanvas.py index 9fedcd7278..6757931c2f 100644 --- a/wxPython/demo/GLCanvas.py +++ b/wxPython/demo/GLCanvas.py @@ -98,14 +98,18 @@ else: self.Bind(wx.EVT_LEFT_UP, self.OnMouseUp) self.Bind(wx.EVT_MOTION, self.OnMouseMotion) + def OnEraseBackground(self, event): pass # Do nothing, to avoid flashing on MSW. + def OnSize(self, event): size = self.GetClientSize() if self.GetContext(): self.SetCurrent() glViewport(0, 0, size.width, size.height) + event.Skip() + def OnPaint(self, event): dc = wx.PaintDC(self) @@ -115,12 +119,15 @@ else: self.init = True self.OnDraw() + def OnMouseDown(self, evt): self.CaptureMouse() + def OnMouseUp(self, evt): self.ReleaseMouse() + def OnMouseMotion(self, evt): if evt.Dragging() and evt.LeftIsDown(): self.x, self.y = self.lastx, self.lasty @@ -259,7 +266,7 @@ overview = """\ if __name__ == '__main__': import sys,os import run - run.main(['', os.path.basename(sys.argv[0])]) + run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])