White Indeterminate Progress Indicator (AKA: White NSProgressIndicator)

Posted by Dallas on December 28, 2008
Cocoa, Objective-C, Programming

If you have ever wanted to use a Indeterminate Spinner NSProgressIndicator on a dark background you have probably been upset to find that there is no way to get a white spinner.
That is where WhiteIntermProgIndicator comes into play.
WhiteIntermProgIndicator, is based off of AMIndeterminateProgressIndicatorCell by Andreas at Harmless Cocoa.

Screenshot:
whiteintermprogindicator

Download: WhiteIntermProgIndicator.zip

Tags: , ,

1 Comment to White Indeterminate Progress Indicator (AKA: White NSProgressIndicator)

Johan Kool
October 8, 2009

Thanks, useful code. Here is a small patch to get it to work too when setSpinning: is called from another thread.

- (void)setSpinning:(BOOL)value
{
if (spinning != value) {
spinning = value;

if (value)
{
if (theTimer == nil)
{
theTimer = [[NSTimer timerWithTimeInterval:animationDelay target:self selector:@selector(animate:) userInfo:NULL repeats:YES] retain];
// Add the timer to the main loop, because it’s possible this indicator will get started from another thread
[[NSRunLoop mainRunLoop] addTimer:theTimer forMode:NSDefaultRunLoopMode];
}
else
{
[theTimer fire];
}
}
else
{
[theTimer invalidate];
// Cleanup
[theTimer release];
theTimer = nil;
}
}
}

Leave a comment

WP_Big_City