Beppe wrote:
your hint is much interesting even if I would write
so much code to intercept the mouse event in every frame
of my app.
You could use a decorator -- so only one additional line per event.
I'm thinking on another approach.
Using wx.EVT_IDLE, making...
This would mostly work, however:
You get an IDLE event went the event stack empties. Generally, that happens pretty frequently in between user interactions. However, in theory, if the user was doing a lot -- the event stack could not empty for along time. This may not be a practical problem, however.
class App(wx.App):
def OnInit(self):
self.Bind(wx.EVT_IDLE, self.OnIdle)
def OnIdle(self, event):
print event
I have notice that the IdleEvent trace change when I use
the app...but here I'm stop.
Similar to what Steven suggested:
In OnIdle, re-start a timer for x seconds.
When the timer fires, close the app (or put up a dialog, or...)
since the timer will be re-started on each IDLE event, it will only fire when there has not been an IDLE event in a long time.
Perhaps there should be an optional monitor of the event stack built in to wx?
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov