Shared User Defaults and NSStepper

Christiaan Hofman cmhofman at gmail.com
Mon Oct 22 10:55:39 PDT 2007


Well, as you say, this binding is not available. So you'll have to  
use old fashioned methods. I don't know if you want the increment to  
be saved in the prefs, but if you want that, you should certainly  
bind the slider. Probably the easiest way to handle the stepper is to  
set the increment programatically in an action for the slider, and of  
course in awakeFromNib or windowDidLoad.

Christiaan

On 19 Oct 2007, at 6:31 AM, Chad Armstrong wrote:

> In my application, I have an NSSlider in the Preference window,  
> which I want to be able to set the Increment Amount for an  
> NSStepper.  I'm making use of Shared Defaults bindings, however, it  
> appears that the Increment Amount is not one of the values that is  
> supported by bindings (however, the min value and max values are  
> supported).
>
> What would be a good method for the NSStepper to adjust it's  
> Increment Amount value whenever the NSSlider is changed in the  
> Preference window?  Should I avoid using the Shared Default  
> bindings in this case and use a notification instead?  Or is there  
> a way to programatically bind the NSSlider's value to the  
> NSStepper's Increment Amount value?
>
> Regards,
>
> Chad



More information about the MacOSX-dev mailing list