Re: Changing the Color of NSProgressIndicator with CGContextSetBlendMode
Re: Changing the Color of NSProgressIndicator with CGContextSetBlendMode
- Subject: Re: Changing the Color of NSProgressIndicator with CGContextSetBlendMode
- From: Mike Abdullah <email@hidden>
- Date: Wed, 21 Feb 2007 11:59:10 +0000
But it sounds like he's adding the custom view as a subview of the
progress indicator which is perfectly acceptable. You're just not
allowed to have both as subviews of the window and overlap.
Mike.
On 21 Feb 2007, at 00:39, Andrew Merenbach wrote:
Hi, Rob. Although the method -addSubview:position:relativeTo:
exists, the current state of Mac OS X Cocoa is such that
overlapping views are, unfortunately, not supported. Someone will
likely respond with a relevant quote from the documentation that
might have missed your research. You will likely have to find a
different way to color your progress indicator, although I do not
have any ideas as to what that would be.
Cheers,
Andrew
On Feb 20, 2007, at 4:15 PM, Robert Kukuchka wrote:
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:
40ucla.edu
This email sent to email@hidden
_______________________________________________
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:
40mikeabdullah.net
This email sent to email@hidden
_______________________________________________
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