[wxPython] OGL

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

Works as expected on Windows, at least with 2.2.1...

···

-------------------------------------------------------------------------
Chris Fama <mailto:Chris.Fama@uq.net.au> Phone:(07) 3870 5639
Brisbane, Australia Mobile:(0400) 833 700
-------------------------------------------------------------------------
You have a mighty arm; strong is your hand, and high is Your right
hand. Righteousness and justice are the foundation of your throne;
mercy and truth go before Your face. Blessed are the people who know
the joyful sound! They walk, O LORD in the light of Your
countenance. In your name they rejoice all day long, and in your
righteousness they are exalted. For our shield belongs to the LORD. -
                             Psalm 89:13-18

-----Original Message-----
From: wxpython-users-admin@lists.sourceforge.net
[mailto:wxpython-users-admin@lists.sourceforge.net]On Behalf Of Denny De
La Haye
Sent: Wednesday, 8 November 2000 9:57 PM
To: wxpython-users@lists.sourceforge.net
Subject: [wxPython] OGL

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

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/mailman/listinfo/wxpython-users