X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6bddd8c5f3cf709fc95747a4fe211690456e157d..08f6ac314ae712e2bc8fa59cf688e6bcff76181f:/utils/wxPython/demo/wxGLCanvas.py diff --git a/utils/wxPython/demo/wxGLCanvas.py b/utils/wxPython/demo/wxGLCanvas.py index 98ccbd9dba..2ff0482a7f 100644 --- a/utils/wxPython/demo/wxGLCanvas.py +++ b/utils/wxPython/demo/wxGLCanvas.py @@ -20,6 +20,7 @@ else: def runTest(frame, nb, log): #win = TestGLCanvas(nb) + #win.SetFocus() #return win win = wxFrame(frame, -1, "GL Cube", wxDefaultPosition, wxSize(400,300)) canvas = TestGLCanvas(win) @@ -34,6 +35,10 @@ else: wxGLCanvas.__init__(self, parent, -1) EVT_ERASE_BACKGROUND(self, self.OnEraseBackground) self.init = false + EVT_CHAR(self, self.MyOnChar) + + def MyOnChar(self, event): + print "MyOnChar" def OnEraseBackground(self, event): pass # Do nothing, to avoid flashing. @@ -50,7 +55,7 @@ else: dc = wxPaintDC(self) ctx = self.GetContext() - if ctx == "NULL": return + if not ctx: return self.SetCurrent() @@ -125,6 +130,7 @@ else: +#----------------------------------------------------------------------