Re: Unable to get animation of NSProgressIndicator on my custom view (subclassed)
Re: Unable to get animation of NSProgressIndicator on my custom view (subclassed)
- Subject: Re: Unable to get animation of NSProgressIndicator on my custom view (subclassed)
- From: Quincey Morris <email@hidden>
- Date: Fri, 15 Jan 2010 12:44:01 -0800
On Jan 15, 2010, at 12:03, cocoa learner wrote:
> My NSProgressIndicator is not animating (determinant/indeterminant in both
> the cases), I have implemented the arrangement in following way -
>
> 1>. main window,
> 2>. NSImageView over main window's content view,
> 3>. Then my custom view(subclassed NSView), over NSImageView,
> 4>. Then over my custom view (subclassed NSView), I have
> NSProgressIndicator.
>
> These all arrangements are done using IB.
>
> But when I am executing following code, I am not see animation in my
> progress bar -
>
> [progressBar setHidden: NO];
>
> [progressBar setIndeterminate: YES];
>
> [progressBar startAnimation: self];
>
> [progressBar displayIfNeeded];
AFAIK, the "animation" meant by 'startAnimation:' is *not* the animation of the pattern inside the progress indicator, but an animation of the change in the length of the filled-in part of the progress bar. That is, when it goes from 1/4 to 1/2, say, without animation the blue bar just jumps in length, but with animation it slides along smoothly. For an indeterminate progress bar, the animation does nothing for you (because the bar is always full).
The pattern animation happens as a regular display update. If your code doesn't return to the main event loop (or otherwise make calls to the progress bar during a compute loop), the indicator won't update. If you invoke '[progressBar setDoubleValue: 0]' often enough during your loop, you should see the pattern animate. (Also, this must be done on the main thread.)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden