R rethish macrumors member Original poster Oct 16, 2008 41 0 Nov 3, 2008 #1 How to use NSStepper? Give a simple example
lee1210 macrumors 68040 Jan 10, 2005 3,182 3 Dallas, TX Nov 3, 2008 #2 http://www.cocoadev.com/index.pl?NSStepperUnusable There's an example here to download, plus a code snippet in the thread itself. -Lee
http://www.cocoadev.com/index.pl?NSStepperUnusable There's an example here to download, plus a code snippet in the thread itself. -Lee
K kainjow Moderator emeritus Jun 15, 2000 7,958 7 Nov 3, 2008 #3 Well steppers first need a minimum and maximum value and a starting value: Code: [stepper setMinValue:0.0]; [stepper setMaxValue:100.0]; [steper setDoubleValue:50.0]; To know when the stepper value has changed, give it a target and action. This is usually done in Interface Builder. Then in the action method you can access the stepper's value like any other control (since it inherits from NSControl): Code: - (IBAction)stepperAction:(id)sender { [textField setDoubleValue:[stepper doubleValue]]; }
Well steppers first need a minimum and maximum value and a starting value: Code: [stepper setMinValue:0.0]; [stepper setMaxValue:100.0]; [steper setDoubleValue:50.0]; To know when the stepper value has changed, give it a target and action. This is usually done in Interface Builder. Then in the action method you can access the stepper's value like any other control (since it inherits from NSControl): Code: - (IBAction)stepperAction:(id)sender { [textField setDoubleValue:[stepper doubleValue]]; }