wxTimer never times out sometimes

Jeffrey Barish jeff_barish at earthlink.net
Thu Aug 17 17:03:33 PDT 2006


Josiah Carlson wrote:

> 
> Jeffrey Barish <jeff_barish at earthlink.net> wrote:
> [snip]
>> Thanks for your comments.  You raise a good point, but there is only one
>> thread.  I was thinking that the actions that result in calls to
>> wxTimer.Start() happen asynchronously to the timer.  Accordingly, it
>> could be possible that the timer is running code for dealing with actions
>> the timer takes at the end of the timer period at the moment it receives
>> the
>> Start() call.  If so, perhaps it goes into a state in which it does not
>> transmit the timer event and does not properly reset the timer.  The
>> critical section would be the code that handles the timeout to be sure
>> that the timer does everything that needs to be done before it responds
>> to the
>> new Start() call.  It's also possible that I am completely wrong, but I
>> have no other theory for explaining why I never get a timer event
>> sometimes.  I know that the timer was triggered because I display a
>> static
>> bitmap at the same time.  When the timer times out, the static bitmap
>> should disappear and I should see a message indicating that I made it to
>> the timer event handler.  Neither thing happens.  Also, it is not
>> possible to trigger the timer again.
> 
> Have you tried .Stop() then .Start()?
> 
>  - Josiah

I did not try it because the documentation says that "If the timer was
already running, it will be stopped by this method [start] before
restarting it."  However, if you think that it might make a difference, I
will try it.  At this point, I have nothing else to try, so any suggestion
is welcome.
-- 
Jeffrey Barish





More information about the wxpython-users mailing list