[wxPython-users] Catching events for idle timotut
Robin Dunn
robin at alldunn.com
Fri Dec 14 21:06:04 PST 2007
Hubert Hickman wrote:
> We need to implement an idle timeout for our application. Is there an easy way
> to catch command events on an application level? We would use these to reset a
> timer and then let them go to wherever they would normally go.
>
> We can do this by hooking in to the various event handling methods in our app in
> a piecemeal way, but it would cleaner if we could do at a more global method.
The last place that unhandled events are sent to is the wx.App object.
So that is one place to catch the events, but handlers bound there will
be called *after* the other handlers, and you seem to be wanting to get
them first. For that you can create a new class derived from
wx.EvtHandler, bind your handlers there, and then push a new instance of
this class on your other widgets with widget.PushEventHandler()
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list