Shared User Defaults and NSStepper

  • 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
  • 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
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today