• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSSliderCell private variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Quartz call to generate shadows?
      • From: email@hidden
    • Re: NSSliderCell private variables
      • From: Cyril Godefroy <email@hidden>
References: 
 >NSSliderCell private variables (From: Cyril Godefroy <email@hidden>)

  • Prev by Date: Overriding NSSlider/NSSliderCell: continued
  • Next by Date: Re: NSTextView scrolling
  • Previous by thread: NSSliderCell private variables
  • Next by thread: Re: NSSliderCell private variables
  • Index(es):
    • Date
    • Thread