[wxPython-users] Re: wxTimer never times out sometimes

Robin Dunn robin at alldunn.com
Fri Aug 18 17:30:42 PDT 2006


Jeffrey Barish wrote:
> 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?

Unfortunately I don't.

-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list