Re: NSSliderCell private variables
Re: NSSliderCell private variables
- Subject: Re: NSSliderCell private variables
- From: Cyril Godefroy <email@hidden>
- Date: Tue, 12 Feb 2002 09:14:44 +0100
John,
in the code you demonstrate, there is no cell for the knob. If I want to
draw something else than a rect, for example an image, I'd have to add a
cell to my subclass.
Do you mean that the knob as it is now coded in NSSliderCell is just a
NSRectFill? I guess not (didn't look at a NSSlider recently though ;-).
I'd believe it's a NSButton or something like that.
Thanks for the precision though.
Cyril
On Monday, February 11, 2002, at 09:01 PM, John C. Randolph wrote:
Cyril,
There's no ned to redo the whole class. All you need to do to
customize the knob in an NSSliderCell subclass is override -drawKnob:,
e.g:
@implementation GradientSliderCell
- (void) drawKnob:(NSRect) knobRect
{
[[[NSColor blueColor] blendedColorWithFraction:[self floatValue]
ofColor:[NSColor greenColor]] set];
NSRectFill(knobRect);
}
@end
The slider in this case has the range 0.0 to 1.0.
-jcr
John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
_______________________________________________
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.