Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to label the tick marks on an NSSlider

Tags:

cocoa

nsslider

I have some vertical sliders and I want to be able to label the tick marks with the values they represent. Is there a better way to do this besides manually putting labels next to them in the Interface Builder? If not, is there a way to at least make those labels line up right with the tick marks or do I have to do it freehand?

like image 349
nonex Avatar asked Jan 22 '26 14:01

nonex


1 Answers

I don't see any builtin capability to label tickmarks. However, see NSSliderCell, which has a method called -rectOfTickMarkAtIndex:: Apple's NSSliderCell documentation

This appears to be the way to ensure your labels are correctly aligned with the tick marks.

like image 114
bneely Avatar answered Jan 25 '26 09:01

bneely



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!