Real Software Forums
http://forums.realsoftware.com/

Slider - Cocoa
http://forums.realsoftware.com/viewtopic.php?f=7&t=47647
Page 1 of 1

Author:  Kuzey [ Fri Apr 19, 2013 3:38 pm ]
Post subject:  Slider - Cocoa

I have a slider with the settings of -100 for minimum and 100 for maximum. This works in Carbon, but the negative values are ignored in Cocoa.

I'm using RS 2012r2...is this a bug or standard behavior?

Thanks,

Kuzey

Author:  kermit [ Fri Apr 19, 2013 3:56 pm ]
Post subject:  Re: Slider - Cocoa

Make your slider have min 0 and max 200.
Subtract 100 from .value before use

Author:  DaveS [ Fri Apr 19, 2013 4:09 pm ]
Post subject:  Re: Slider - Cocoa

kermit wrote:
Make your slider have min 0 and max 200.
Subtract 100 from .value before use


you mean from min 100 to max 200

Author:  Kuzey [ Fri Apr 19, 2013 4:33 pm ]
Post subject:  Re: Slider - Cocoa

Thanks guys,

I hope they update the language reference so I won't forget in a few months.

I do believe kermit is right, 0 to 200 and set the value to 100 in the property panel...so it's in the center on open & you have 100 on either side...I think.

:)

Kuzey

Author:  rowlands [ Fri Apr 19, 2013 9:59 pm ]
Post subject:  Re: Slider - Cocoa

Kuzey wrote:
Thanks guys,

I hope they update the language reference so I won't forget in a few months.

I do believe kermit is right, 0 to 200 and set the value to 100 in the property panel...so it's in the center on open & you have 100 on either side...I think.

:)

Kuzey

Indeed that will work, or you could use a declare to get at NSSlider's value.
soft declare function doubleValue lib "Cocoa" selector "doubleValue" (Ref as integer) as Double
return doubleValue(me.handle)

Author:  Kuzey [ Sat Apr 20, 2013 5:57 am ]
Post subject:  Re: Slider - Cocoa

Hi Sam,

How would you actually use that, I have no experience with declares.


Kuzey

Author:  rowlands [ Sat Apr 20, 2013 6:38 am ]
Post subject:  Re: Slider - Cocoa

Kuzey wrote:
Hi Sam,

How would you actually use that, I have no experience with declares.


Kuzey


okay - this is untested, but it should go something like...

soft declare function doubleValue lib "Cocoa" selector "doubleValue" (Ref as integer) as Double
Dim sliderValue as double = doubleValue( slider1.handle)


where slider1 is the name of your slider. Once you've gotten it working, you can wrap it into a method so you can use it in many places.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/