custom NSSliderCell

前端 未结 4 1595
无人共我
无人共我 2020-12-29 15:08

I\'ve sort of accomplised implementing a custom slider cell that can draw over using images for the scroll bar and knob. The only obstacle that is in the way now is this, wh

4条回答
  •  独厮守ぢ
    2020-12-29 15:34

    Ok, so it's figured out. apparently the slider was trying to be smart and draw only where the knob has been. so apparently I have to invalidate the rect all the time by overriding setNeedsDisplayInRect in the slider class.

    #import "customSlider.h"
    
    @implementation customSlider
    -(void)setNeedsDisplayInRect:(NSRect)invalidRect{
        [super setNeedsDisplayInRect:[self bounds]];
    }
    @end
    

提交回复
热议问题