All events that are not processed by wx event bindings (or that are processed but the handler calls Skip) are sent to the app object before wx gives up and returns the event to the system for default processing. So one way to implement this would be to bind a handler to the app for the mouse and key events. In that handler you could reset your timer back to 60 seconds and call Skip so the default processing will still happen for the event.
···
On 10/1/09 1:18 AM, Elias Alhanatis wrote:
Dear friends ,
I would like to have my app "lock" and expect a password after
lets say one minute of "idleness". I tried to combine a wx.EVT_IDLE
handler with a wx.Timer but the results where not what i expected.
In other words , my question is , how can i have an "internal" timer that
fires every minute , but resets on each event that happens on the GUI?
Thank you so much for your answer and the time you took to
write it. I did not realize before that i could bind a handler
to the whole app ...and now i know i can!!!!! Thats what i did
and it worked like a charm! Thanks again!!!!!!!
Elias Alhanatis
Greece
···
On Oct 2, 11:03 pm, Robin Dunn <ro...@alldunn.com> wrote:
On 10/1/09 1:18 AM, Elias Alhanatis wrote:
> Dear friends ,
> I would like to have my app "lock" and expect a password after
> lets say one minute of "idleness". I tried to combine a wx.EVT_IDLE
> handler with a wx.Timer but the results where not what i expected.
> In other words , my question is , how can i have an "internal" timer that
> fires every minute , but resets on each event that happens on the GUI?
All events that are not processed by wx event bindings (or that are
processed but the handler calls Skip) are sent to the app object before
wx gives up and returns the event to the system for default processing.
So one way to implement this would be to bind a handler to the app for
the mouse and key events. In that handler you could reset your timer
back to 60 seconds and call Skip so the default processing will still
happen for the event.
--
Robin Dunn
Software Craftsmanhttp://wxPython.org