wx.Timer accurate?

You should have just included the whole app. My hope was that I could
just cut-and-paste it here and play with it to figure out what was going
on. Now, I'm going to have to spend multiple minutes to figure out and
recreate what your layout must have been.

The app and sizer stuff is only a few lines of code, and if you've
lurked here for any time, you'll know that people have posted samples
longer than yours by at least an order of magnitude.

However, I will give it a shot.

···

On Wed, 26 Jul 2006 12:47:51 -0400, "John Salerno" <johnjsal@gmail.com> wrote:

Can you post your code for us?

Ok, I wanted to avoid it because I didn't want it to be too long and
annoying, but this might help. I'll cut out the layout stuff (sizers)
and the App class for a little brevity:

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

I can see one thing that might be fooling you. Here's your computation
of the progress value:
           self.progress.SetValue(self.minutesPassed * (100 / self.time))
You shouldn't have that extra set of parentheses in there. That
division is going to be an INTEGER division. So, for example, if you
set the time to 60, 100/60 is 1, so the display is never going to go
past 60. When you're converting from one range to another, you should
always do the multiply first, THEN the division.

Alternatively, you could just change the range of the progress bar to
the time value and skip the division altogether.

You don't ever stop the timer. You should include a "self.timer.Stop()"
in the else clause of your OnTimer handler. You also probably want a
"self.start.Enable()" inside the OnReset handler.

With those changes, your app seems to work fine for me.

···

On Wed, 26 Jul 2006 12:47:51 -0400, "John Salerno" <johnjsal@gmail.com> wrote:

Can you post your code for us?
     

Ok, I wanted to avoid it because I didn't want it to be too long and
annoying, but this might help. I'll cut out the layout stuff (sizers)
and the App class for a little brevity:
   
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.