[wxPython] Idle Event Bug?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[wxPython] Idle Event Bug?

Tyeler Quentmeyer
I'm running wxPython on a Redhat 6 box using the RPM distribution on the
wxPython page.  I'm trying to have my program animate a series of
bitmaps and still receive normal graphical input.  Thus, I'm trying to
capture idle events and stick my code in an OnIdle function to flip the
bitmaps.  No matter where I try and capture the events (wxApp, wxFrame,
wxPanel..), my function only gets called when I generate an event which
isn't specifically handled (i.e., I move the mouse around inside the
window).  Am I using the idle event wrong?  Is there another way to
animate a series of bitmaps?



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [wxPython] Idle Event Bug?

Robin Dunn


> I'm running wxPython on a Redhat 6 box using the RPM distribution on the
> wxPython page.  I'm trying to have my program animate a series of
> bitmaps and still receive normal graphical input.  Thus, I'm trying to
> capture idle events and stick my code in an OnIdle function to flip the
> bitmaps.  No matter where I try and capture the events (wxApp, wxFrame,
> wxPanel..), my function only gets called when I generate an event which
> isn't specifically handled (i.e., I move the mouse around inside the
> window).  Am I using the idle event wrong?  Is there another way to
> animate a series of bitmaps?
>

Are you calling event.RequestMore(true)?  From the docs:

wxIdleEvent::RequestMore
void RequestMore(bool needMore = TRUE)

Tells wxWindows that more processing is required. This function can be
called by an OnIdle handler for a window or window event handler to indicate
that wxApp::OnIdle should forward the OnIdle event once more to the
application windows. If no window calls this function during OnIdle, then
the application will remain in a passive event loop (not calling OnIdle)
until a new event is posted to the application by the windowing system.


--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [wxPython] Idle Event Bug?

Robin Dunn
In reply to this post by Tyeler Quentmeyer
> Is there another way to
> animate a series of bitmaps?
>

One more thing, I assume for your animation you want to have a (nearly)
constant time between frames?  If so then using a timer would probably be
better than idle events.

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users




Loading...