Re: Progress bar jitters
Re: Progress bar jitters
- Subject: Re: Progress bar jitters
- From: Nick Zitzmann <email@hidden>
- Date: Thu, 24 Aug 2006 15:40:35 -0600
On Aug 24, 2006, at 2:39 PM, Trygve Inda wrote:
In the Apple sample code, QTKitProgressTester, why does the
progress bar
jitter... That is it goes up some, then jumps back?
There's a bug in NSProgressIndicator where very small updates cause
the bar to become jumpy. We worked around the problem by doing this,
assuming you set the indicator's maximum to 1.0 and you're pushing a
percentage: (warning - written in Mail, untested, use at your own
risk, etc.)
int iterator;
int count = (maximum number here);
double countf = count;
double lastProgressValuef = 0.0;
for (well, you know...)
{
double iterationsf = iterator;
int percentAsInt = (iterationsf/countf)*200.0;
double modifiedProgressValuef = percentAsInt/200.0;
// do your work, then...
if (modifiedProgressValuef != lastProgressValuef)
{
lastProgressValuef = modifiedProgressValuef;
[yourProgressIndicator setValue:modifiedProgressValuef];
}
}
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden