Preventing NSSlider bar from drawing
Preventing NSSlider bar from drawing
- Subject: Preventing NSSlider bar from drawing
- From: Michael Watson <email@hidden>
- Date: Tue, 16 Jan 2007 11:24:42 -0500
Thanks to all who helped me solve my IB/-initWithCoder: problem
solved previously.
So my custom NSSlider/NSSliderCell is drawing as I expect, except for
one small quirk: I can't seem to prevent the original Aqua bar from
drawing. Currently, I'm overriding -[NSSliderCell drawKnob:] and -
[NSSliderCell drawBarInside:flipped:], and those correctly invoke my
drawing commands. I'm still left with the original Aqua bar benath
what I've drawn, however.
If I override -[NSCell -drawWithFrame:inView:], I can prevent the bar
from drawing, but the position at which the knob draws doesn't
reflect the current doubleValue until I click the slider and begin
using it. (It draws at 0,0 initially and doesn't get erased until I
drag the knob over it.)
My current thinking is that I need to override the -
drawWithFrame:inView: method, lock focus on the control view, call -
drawBarInside:flipped:, call -drawKnob: (not -drawKnob), and then
unlock focus. If this is the case, is there a good way to determine
what rect to pass into -drawKnob:?
--
mikey
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden