wxTimer never times out sometimes

Jeffrey Barish jeff_barish at earthlink.net
Fri Aug 18 08:49:18 PDT 2006


Robin Dunn wrote:

> Jeffrey Barish wrote:
>> I use the timer in one-shot mode to trigger an action after the user
>> stops
>> using the GUI.  As long as the user is clicking on elements in the GUI,
>> the
>> timer gets retriggered (using Start).  This scheme works fine most of the
>> time, but once in a while the event handler never gets called.  After the
>> timer fails once, it seems to be inoperable.  That is, I don't get a
>> timeout after performing additional actions that normally would trigger
>> the
>> timer.  The only way to restore correct operation is to exit the program
>> and restart it.  My only theory is that something goes wrong if wxTimer
>> receives a start command at the same time that it is timing out.  That is
>> the only scenario I can think of consistent with the sporadic nature of
>> the
>> problem.  Perhaps there needs to be a critical section in the code.
> 
> A critical section would only be needed if threads are involved, but
> since timers are implemented as events from the platform there shouldn't
> be any.  They are delivered like any other event.
> 
That makes sense.  Do you have a suggestion, then, as to why I am not
receiving an event?
-- 
Jeffrey Barish





More information about the wxpython-users mailing list