Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change NSSlider Value programmatically

Is there a way to make an IBOutlet of an NSSlider and then be able to change its value programmatically? slider.value = ...does not work.

Thanks!

like image 843
Grant Wilkinson Avatar asked Mar 26 '12 06:03

Grant Wilkinson


2 Answers

You can use the methods of NSControl.

Example: [self.slider setDoubleValue:0.1];

like image 117
Schulze Thomas Avatar answered Nov 19 '22 20:11

Schulze Thomas


Swift answer to this question is to use the doubleValue property to access the slider value in OSX:

slider.doubleValue = 0.1 

print(slider.doubleValue)
like image 25
Leo Dabus Avatar answered Nov 19 '22 20:11

Leo Dabus