Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

anni.saini

macrumors newbie
Original poster
hi,

I want to use NSStepper with NSTextField and want to set some initial value in the NSTextField (let say 3).

I implemented code for this and set min and max value for stepper to 1 and 100 and increment value to 1.

I have set the initial value of NSTextField to 3.

I have one issue with this:
1. When first time, I clicked on stepper it randomly increments the value and afterward it works fine (increments value properly).
2. When I didn't set any initial value for NSTextField, it takes zero default.

Can anybody know how can I set initial value for stepper, so that it works fine.

thanks,
Anni
 
hi robbieduncan,

thanks for the help... its working for initial value.

however I have observe more issue there:
1. When I first time clicked on up arrow it shows me value 2 even though I set setIntValue to 3.
2. And when I clicked down first time it shows value 1.

Couple of solutions that I tried:
-- I tried by opting continuous option for text field
-- setting NSTextField value to same as that I set to setIntValue
-- binding Stepper and NSTextField with the same control.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.