Robin Dunn wrote:
altern wrote:
As far as I understand if i create a wx.Timer that every X millisecs calls Refresh() on the glcanvas this should trigger a wx.EVT_PAINT which would call the function binded to that event (like self.Bind(wx.EVT_PAINT, self.draw) ) then here I would just need to do the usual, something like this
def draw(self):
dc = wx.PaintDC(self.glcanvas) # prepare glcanvas for opengl drawing
self.glcanvas.SetCurrent()
#.... etc ... until
self.glcanvas.SwapBuffers()Is what I say correct?
You should bind the handler to the self.glcanvas window, not to self. The draw method can still be in the self class if you want to organize it that way, but the way you show it above you are painting self.glcanvas in response to self's EVT_PAINT event, and that is clearly wrong.
bingo.
plus i was doing something totally stupid somewhere else which made me totally confused.
thank you very much!
···
-
enrike