• 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: 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.

  • Follow-Ups:
    • Re: NSSliderCell private variables
      • From: "John C. Randolph" <email@hidden>
References: 
 >Re: NSSliderCell private variables (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: Drag n Drop on a NSControl : NSTextField?
  • Next by Date: how to use Cocoa Java from Cocoa Obj-C code?
  • Previous by thread: Re: NSSliderCell private variables
  • Next by thread: Re: NSSliderCell private variables
  • Index(es):
    • Date
    • Thread