Re: NSSliderCell private variables
Re: NSSliderCell private variables
- Subject: Re: NSSliderCell private variables
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 11 Feb 2002 12:01:50 -0800
On Sunday, February 10, 2002, at 10:21 AM, Cyril Godefroy wrote:
Yes, I know I shouldn't, but rather than having to redo the
whole NSSliderCell class, I'd rather just override it.
And the cell in which the knob is is a private method/variable.
I need to set an image for this cell, and to be ableto move it
just a bit from its usual place.
Does anyone know the private name of it or would tell me a way
to find it?
Tia,
Cyril
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.