How to use NSLevelIndicator

I tried binding its value to a variable but that didn’t seem to work. Any insight?

Scratch that, binding its value to a variable in my delegate does work

So now im wondering how I could link a slider to that level indicator

i.e
1.have a slider with 3 values
2. have a level indicator with 3
3. link the slider to the level indicator

Check this out, its quite simple:


	property se_slider : missing value
	property se_level : missing value
	
	
	on sliderChange_(sender)
		set se_sliderCurrent to se_slider's doubleValue()
		se_level's setDoubleValue_(se_sliderCurrent)
	end sliderChange_

bind se_slider and se_level to the silder and the level, and put the sliderChange_() on the slider.

When you set the max and min value to 0-3 you get values like 2.738181929 (or such) but they’ll translate into the leveler

Use the same maximums on both slider and level

Now, we only have to figure out, how to make the sliderbutton snap to the tickmarks, so the value we get is not “2.4577328” but exactly 2.
This might work with reading out the value of the level after setting it, and then setting the sliderbutton to that value, but there must be an easier way. :slight_smile:

Thanks for the help

as for the slider you can set it to “Only Stop on Tick Marks Only” in the inspector

xD Stupid me, anyway, I hope you can use the code :slight_smile: