This is what happens when I create an NSProgressIndicator and use NSStatusItem
's -setView:
method to display it in the menubar area while I'm performing an action:
Example of messed up NSProgressIndicator http://cl.ly/l9R/content
What causes this border to be displayed, and how can I remove it? The intended result is that the control be transparent.
Here's the code I'm using:
NSProgressIndicator *progressIndicator = [[NSProgressIndicator alloc] init];
[progressIndicator setBezeled: NO];
[progressIndicator setStyle: NSProgressIndicatorSpinningStyle];
[progressIndicator setControlSize: NSSmallControlSize];
[progressIndicator sizeToFit];
[progressIndicator startAnimation: self];
[statusItem setView: progressIndicator]; // statusItem is an NSStatusItem instance
...
[statusItem setView: nil];
[progressIndicator stopAnimation: self];
[progressIndicator release];
Don’t scale the
NSProgressIndicator
though it’s also anNSView
. Create a new view that resizes fine, position the status indicator in that view, and pass the enclosing view to-[NSStatusItem setView:]
. Here is my implementation.In
NSStatusItem+AnimatedProgressIndicator.m
,I added a custom method,
-[NSView center]
, which does the following:I've seen you solved the problem I will leave this is an alternative to your implementation. You can use ProgressHud.