I need to subclass NSSliderCell to customise its appearance. I had no problem with the bar, I overrode
- (void)drawBarInside:(NSRect)aRect flipped:(BOOL)flipped
and it works as expected.
- (void)drawKnob:(NSRect)knobRect
works as well, but I want a smaller knob, and resizing the NSRect isn't an option, because I have an unwanted space either on the right or on the left (or both, if I center my custom knob).
Reading the documentation, I should override
- (void)drawKnob
to calculate the rect in which the knob should be drawn, then call drawKnob: The problem is that, trying to get the cellSize to compute where I should draw the knob, I get an absurd width : 40000
How can I get the right width? NSSliderCell is a subclass of NSCell, so I can't access frame/bounds.
-knobThickness
as well. I can't remember if that's necessary or not. – Wevah