I have a weird glitch with my early OGL experimentation...
although I have set the background colour of the canvas to
wxRED, it seems to obstinately remain white, albeit with an
occasional flicker of red showing through when you use the
scrollers or resize it...
Code included - anyone tell me what I'm doing wrong?
Regards,
Denny
PS - I'm on #wxPython on irc.openprojects.net if anyone
wants to come and chat today...
···
----------------------------------------------------------
Denny De La Haye \ www-edc.eng.cam.ac.uk/~djd33
Engineering Design Centre, \ www-edc.eng.cam.ac.uk
Department of Engineering, \ www.eng.cam.ac.uk
University of Cambridge, UK \ www.cam.ac.uk
----------------------------------------------------------
"Linux: Where do you want to go tomorrow?"
----- ( code ) -----
#!/usr/bin/python
from wxPython.wx import * # wxPython GUI toolkit
from wxPython.ogl import * # wxPython OGL extensions
wxOGLInitialize() # initialise OGL extensions
window_size = wxSize (320, 240) # default size for application
class oglShapeCanvas (wxShapeCanvas):
def __init__ (self, parent):
wxShapeCanvas.__init__ (self, parent)
maxWidth = 1000
maxHeight = 1000
self.SetScrollbars (20, 20, maxWidth/20, maxHeight/20)
self.SetBackgroundColour (wxRED) # wtf?
self.diagram = wxDiagram()
self.SetDiagram (self.diagram)
self.diagram.SetCanvas (self)
class oglFrame (wxFrame):
def __init__ (self, parent, ID, title):
wxFrame.__init__ (self, parent, ID, title,
wxDefaultPosition, window_size)
canvas = oglShapeCanvas (self)
class oglApp (wxApp):
def OnInit (self):
win = oglFrame (NULL, -1, 'OGL oddity')
win.Show (true)
self.SetTopWindow (win)
return (true)
app = oglApp()
app.MainLoop()
_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users