Changing NSSliderCell's knob thickness
Changing NSSliderCell's knob thickness
- Subject: Changing NSSliderCell's knob thickness
- From: Brandon Walkin <email@hidden>
- Date: Mon, 17 Aug 2009 02:56:47 -0400
I'm trying to make a vertical slider with a knob that's 1 pt tall. I
can't quite figure out how to do this without rewriting NSSliderCell.
Overriding -knobThickness and returning a particular thickness doesn't
seem to have any effect on the thickness of the knob. The -
setKnobThickness: method is deprecated, but it too seems to have no
effect on the knob size.
I could fake it by drawing a 1 pt tall line in the center of the large
knob rect I'm provided and drawing the slider track with an inset on
both sides so the 1 pt tall knob can reach both ends of the slider.
The issue with that is when the area on the track near the knob is
clicked, the knob won't move to that position. And when that area on
the track is dragged, the knob moves as though it's being dragged.
Since NSSliderCell thinks the knob is thicker, it thinks the click is
on the knob instead of the track.
I've made a basic sample app that you can play with: http://www.box.net/shared/ylqm2uck5o
Any help would be appreciated. Thanks.
Brandon
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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