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
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.
dc = wxPaintDC(self)
ctx = self.GetContext()
- if ctx == "NULL": return
+ if not ctx: return
self.SetCurrent()
+#----------------------------------------------------------------------
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)