Re: Drawing a *blue* ProgressIndicator on the Dock app icon in the background / offscreen drawing
Re: Drawing a *blue* ProgressIndicator on the Dock app icon in the background / offscreen drawing
- Subject: Re: Drawing a *blue* ProgressIndicator on the Dock app icon in the background / offscreen drawing
- From: Marc Liyanage <email@hidden>
- Date: Fri, 6 Feb 2004 22:06:22 +0100
Following up to my own post, maybe it helps someone else who wants to
add a progress bar to a dock application icon:
I was able to get it to work by creating a separate NSProgressIndicator
programmatically instead of re-using the image from the existing,
nib-based progress indicator.
I also had to use an NSWindow subclass whose content view holds the
progress indicator view.
The subclass overrides the two methods isKeyWindow and isVisible to
always return true.
#import "AlwaysOnWindow.h"
@implementation AlwaysOnWindow
- (BOOL)isKeyWindow {
return YES;
}
- (BOOL)isVisible {
return YES;
}
@end
id mywin = [[AlwaysOnWindow alloc] initWithContentRect:NSMakeRect(0, 0,
128, 20) styleMask:NSBorderlessWindowMask
backing:NSBackingStoreBuffered defer:NO];
id myIndicator = [[NSProgressIndicator alloc]
initWithFrame:NSMakeRect(0, 0, 128, 20)];
[[mywin contentView] addSubview:myIndicator];
[myIndicator setIndeterminate:NO];
The rest works exactly like in my earlier code snippet.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.