It turns out if I use setUsesThreadedAnimation:YES on the progress indicator, the bar indicator animates.

The docs say this method sets a hint as to whether the receiver should implement animation of the progress indicator in a separate thread. I guess the hint is taken and the animation is performed in a separate thread.

Jim Merkel


On Jun 19, 2011, at 1:38 PM, James Merkel wrote:


On Jun 19, 2011, at 1:27 PM, Quincey Morris wrote:

On Jun 19, 2011, at 13:14, James Merkel wrote:

        ProgressController * progressController = nil;  
        progressController =[[ProgressController alloc] init];
        NSLog(@"Progress window: %@\n", [progressController window]);
        [progressController startProgressAnimation];
        [progressController showWindow:self];

        (Long processing)

        [progressController close];
        [progressController release];

So this works with the spinner but not the bar. Seems strange because I thought the two progress indicators would work the same.

They don't. The spinning indicator animates itself, but the bar animation depends on run loop iterations to drive the animation. If "Long processing" means a loop, you're not going back to the run loop. In those circumstances you must arrange for events to be processed (run the run loop or dequeue events in a modal event loop).

Note that you probably want to do that anyway, because you probably want to have a Cancel button on a long-running operation.


Ok thanks -- I didn't realize there was a difference in the way the two progress indicators worked.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to