Progress Indicators Spin vs Bar
Progress Indicators Spin vs Bar
- Subject: Progress Indicators Spin vs Bar
- From: James Merkel <email@hidden>
- Date: Sun, 19 Jun 2011 13:14:32 -0700
I am trying to do an indeterminate progress indicator in a small
NSPanel window similar to that shown in Figure 15-57 of the
OSXHIGuidelines. The NSPanel and NSProgresssIndicator are in a nib
file and I'm pretty sure the IB connections are correct. If I use a
spin progress indicator, I can start the animation. If I switch to a
bar progress indicator, I can't start the animation. (Looking at the
archives, this seems opposite from what other people have experienced
- they had problems with the spin progress indicator). The code is
pretty simple. I have a ProgressController class defined as follows
in .h and .m files:
@interface ProgressController : NSWindowController {
IBOutlet NSProgressIndicator *progressIndicator;
}
-(void)startProgressAnimation;
@end
#import "ProgressController.h"
@implementation ProgressController
-(id)init{
self = [super initWithWindowNibName:@"ProgressWindow"];
[self setWindowFrameAutosaveName:@"ProgWindow"];
return self;
}
-(void)windowDidLoad{
}
-(void)startProgressAnimation{
NSLog(@"progressIndicator should start");
[progressIndicator startAnimation:nil];
}
@end
Then use the progress indicator as follows;
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.
Thanks for any help.
Jim Merkel
_______________________________________________
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