Re: Obtaining the NSGraphicsContext for custom NSView
Re: Obtaining the NSGraphicsContext for custom NSView
- Subject: Re: Obtaining the NSGraphicsContext for custom NSView
- From: Ryan Stevens <email@hidden>
- Date: Tue, 15 Mar 2005 14:08:12 -0800
On Mar 15, 2005, at 7:43 AM, Serge Meynard wrote:
It looks like you're trying to implement an NSSlider subclass, in which case you're doing more work than you need to. Did you know that you can override -drawKnob: in NSSliderCell?
Oh really? I just got stuff working on my end (I'm not going through the drawRect method). How far can I go in customizing how the slider looks
If you make an NSSliderCell subclass, you can draw whatever you like in -drawInside:inView:.
Also, if your knob or bar aren't the standard size (which varies on controlSize) you'll probably want to override NSSlider's -sizeToFit to keep it from adjusting itself.
When I was looking at NSSlider last week, it struck me that you apparently can't override the tick mark drawing code. I had thought of doing so to selectively change the color of some of the tick marks. Did I miss something?
I don't see why you couldn't grab the
rectOfTickMarkAtIndex: and draw in a different color after super draws. :/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden