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)
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