Friday, November 22, 2019

#1 2019-07-09 01:33:34 am

Budgie
Member
From:: New Zealand
Registered: 2005-02-22
Posts: 703

How to set up a stepper correctly

Hi
I’m trying to set up a stepper in my project, I have bound a text field to the stepper and the stepper to the text field , this works fine, the text field shows the result of the stepper, but I can’t figure out how to get and use the figures displayed in the text field, all the examples I can find are old, an either don’t work or iv’e set it up wrong. Can someone please point me ina direction of a recent example or small project using the stepper so I can see how things are supposed to be done properly please

Cheers


Cheers
Budgie

"There's no shame in accepting aid from others... but perhaps there is a  responsibility."    - Batman

Offline

 

#2 2019-07-09 01:59:17 am

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 6043

Re: How to set up a stepper correctly

Just get the text field's stringValue(), integerValue() or doubleValue(), depending on what you want/need.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#3 2019-07-09 02:44:55 pm

Budgie
Member
From:: New Zealand
Registered: 2005-02-22
Posts: 703

Re: How to set up a stepper correctly

thanks Shane, I understand I need the result, but what happens is
I bind the stepper to the text box using "takeIntValueFrom:" and then
bind the text box to the stepper using "takeStringValueFrom:" which
then when the stepper is clicked it shows the text and increments as expected.

problem is if I make the stepper a _(sender)  then it removes the  "takeIntValueFrom:"
from the text box, and when the stepper is clicked nothing shows.

I have tried

Applescript:

set theValue to (contents of stepper "myStepper")

which does nothing


Cheers
Budgie

"There's no shame in accepting aid from others... but perhaps there is a  responsibility."    - Batman

Offline

 

#4 2019-07-09 03:23:58 pm

Budgie
Member
From:: New Zealand
Registered: 2005-02-22
Posts: 703

Re: How to set up a stepper correctly

got it, I removed the bindings and dealt with it programmatically



Applescript:

property StepperInfo : missing value --bound to stepper

----------------------------------------------
-- STEP ROTATE
----------------------------------------------
on StepRotate_(sender) --bound to stepper

set theValue to StepperInfo's integerValue()
Rotate's setStringValue_(theValue)

set myStep to Rotate's stringValue() --must be a text field to get result from it
set myStep to myStep as string


log myStep


Cheers
Budgie

"There's no shame in accepting aid from others... but perhaps there is a  responsibility."    - Batman

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)