X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cf694132f1c28509a9f84377ce8d374bae4177ad..899493dd6179f91eb97a39339cdcc08b89885a98:/utils/wxPython/demo/wxGLCanvas.py?ds=sidebyside diff --git a/utils/wxPython/demo/wxGLCanvas.py b/utils/wxPython/demo/wxGLCanvas.py index 4290f92767..2ff0482a7f 100644 --- a/utils/wxPython/demo/wxGLCanvas.py +++ b/utils/wxPython/demo/wxGLCanvas.py @@ -19,8 +19,14 @@ else: def runTest(frame, nb, log): - win = TestGLCanvas(nb) - return win + #win = TestGLCanvas(nb) + #win.SetFocus() + #return win + win = wxFrame(frame, -1, "GL Cube", wxDefaultPosition, wxSize(400,300)) + canvas = TestGLCanvas(win) + frame.otherWin = win + win.Show(true) + return None @@ -29,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. @@ -45,7 +55,7 @@ else: dc = wxPaintDC(self) ctx = self.GetContext() - if ctx == "NULL": return + if not ctx: return self.SetCurrent() @@ -120,6 +130,7 @@ else: +#---------------------------------------------------------------------- @@ -140,7 +151,7 @@ overview = """\ def _test(): class MyApp(wxApp): def OnInit(self): - frame = wxFrame(NULL, -1, "HELP ME!!") + frame = wxFrame(NULL, -1, "GL Cube", wxDefaultPosition, wxSize(400,300)) win = TestGLCanvas(frame) frame.Show(TRUE) self.SetTopWindow(frame)