Changing the Color of NSProgressIndicator with CGContextSetBlendMode
Changing the Color of NSProgressIndicator with CGContextSetBlendMode
- Subject: Changing the Color of NSProgressIndicator with CGContextSetBlendMode
- From: Robert Kukuchka <email@hidden>
- Date: Tue, 20 Feb 2007 16:15:17 -0800
Hello,
I'm testing out an idea to change the color of NSProgressIndicator
from it's default state, and I'm getting some weird issues. Any help
would be greatly appreciated.
Here is a simplified version of what I'm doing
1) adding an NSProgressIndicator to my window
2) setControlTint:NSGraphiteControlTint
2) adding a view on top (using addSubview:positioned:relativeTo:)
3) Within the drawRect of my view I do the following:
CGContextSetBlendMode((CGContextRef)[[NSGraphicsContext
currentContext] graphicsPort], kCGBlendModeColor);
[[[NSColor magentaColor] colorWithAlphaComponent:1] set];
[NSBezierPath fillRect:rect];
Results:
I'm getting some "flickering" during progress advancement. I make
sure to call [myView setNeedsDisplay:YES]; anytime I manipulate the
progressBar (such as incrementBy:), but it still occasionally seems
that the NSProgressIndicator is not respecting the Z-Ordering, and I
only see the progress as the Graphite.
Oddly enough if I setIndeterminate to YES, it blends perfectly, only
using a determinate option results in the flickering.
Any ideas?
Cheers
Rob
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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