Re: setting color of a progress indicator?
Re: setting color of a progress indicator?
- Subject: Re: setting color of a progress indicator?
- From: Cryx <email@hidden>
- Date: Sun, 28 Apr 2002 23:00:22 -0500
That's almost exactly what I did, but the solution that works for me is
a little simpler. There's some nice border functions in the AppKit, but
you could probably use a swatch of one the system shadow control colors
to achieve a shadow instead. With some compositing a gradient to round
the indicator could be probably be achieved too.
Here's the basics of what I did:
-(void)drawRect:(NSRect)aRect {
NSRect slice,remainder;
NSRect insetRect = NSInsetRect(aRect,2.0,2.0);
NSDrawGroove(aRect,aRect);
NSDivideRect(insetRect,&slice,&remainder,NSWidth(insetRect)*percent,NSMinXEdge)
;
[[NSColor redColor] drawSwatchInRect:slice];
[[NSColor whiteColor] drawSwatchInRect:remainder];
}
On Sunday, April 28, 2002, at 08:45 PM, Julien Guimont wrote:
I had the same question 2 weeks ago. I think it can't be done by simply
setting something in NSPRogressindicator.
The solution I found, which can be a little more faster, is to make a
new NSView subclass et create your progress bar using a rectangle of
the color of your choice to bound the rect of your view and use a
NSAffineTransform to scale it to the percentage you want. Apply a nice
tiff on that with the same scaling and you have a progress bar.
Yes it has no wavy effect in it but, who wants to spend cycle doing
that;)... I wish I could.
Do you think there is an API to make little shadow (like the one on
window) behind my view, or to make the candy like theme programmaticaly
without using tiff?
Thanx
Julien Guimont
email@hidden
www.juggysoft.com
_______________________________________________
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.
_______________________________________________
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.