Astan,
Sorry about this, but it seems that Im abit mistaken and confused.
Taking out the dc = wx.PaintDC(self) made it possible to do this.
But I was wondering if I could start it whenever the tab is active or stop it whenever the tab is out of focus by setting some event hook somewhere or a parameter somewhere.
Otherwise I'd just put in a timer,right?
Thanks again for the help
Astan
You should be able to use the focus events found here: wxPython API Documentation — wxPython Phoenix 4.2.2 documentation
Or you might be able to use the Notebook page changed event: EVT_NOTEBOOK_PAGE_CHANGED
In the event handler, you could do something like replace the animated gif with just a frame of the gif. I'm sure there's a way to stop the paint events, but I'm not very knowledgeable in that area of wxPython.
Astan Chee wrote:
Hi,
I've tried to put a GLCanvas with nehe's lesson 6 into a wxnotebook.
But a small problem is that the cube doesnt rotate because the EVT_PAINT is only called when there are changes to the tab(resizing/mouse movements).
How do I set so that the EVT_PAINT is always called so that the objects become animated?
Thanks for any help.
Astan
Hope that gives you some ideas!
Mike