setting scrollbar values

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jmd
Posts: 6
Joined: Tue Apr 11, 2006 12:15 am
Contact:

setting scrollbar values

Post by jmd » Sat Sep 05, 2009 12:29 am

I've encountered a small hitch brought by a student who is wanting to set (for whatever reason) a current value to a scrollbar.

The 'set startvalue' and 'set endvalue' work as expected, but the 'set currentvalue' seems to go through the motions (ie, it does not return an error) but does not in fact alter the current value (in both Studio 3.5 and 4.0).

Is there something I'm overlooking???

Image
[url=http://www.fourhares.com]fourhares.com[/url]

shadowslash
Posts: 344
Joined: Tue Feb 24, 2009 6:14 pm
Contact:

Re: setting scrollbar values

Post by shadowslash » Sat Sep 05, 2009 9:35 am

jmd wrote:I've encountered a small hitch brought by a student who is wanting to set (for whatever reason) a current value to a scrollbar.

The 'set startvalue' and 'set endvalue' work as expected, but the 'set currentvalue' seems to go through the motions (ie, it does not return an error) but does not in fact alter the current value (in both Studio 3.5 and 4.0).

Is there something I'm overlooking???
Actually, the correct command would be set the thumbPos of scrollbar "my Loading Bar" to theValue
Parañaque, Philippines
Image
Image

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Sat Sep 05, 2009 1:03 pm

And the reason it won't have caused an error is because you can set a custom property on pretty much any object, so if you examined the custom properties of the scrollbar you would find that it's being set perfectly happily (the currentvalue custom property, that is).

jmd
Posts: 6
Joined: Tue Apr 11, 2006 12:15 am
Contact:

Post by jmd » Mon Sep 07, 2009 8:04 am

Thankyou both for your prompt assistance.

... problem solved!

I would have thought, however, that in this context currentvalue is not considered a custom property, but rather taken as referring to the property name as given by the inspector.

Personally, I'd like to suggest that either "Current value" be changed to "Thumb pos" in the inspector or that currentvalue be added as a recognised property of a scrollbar (given that this property is so named in the inspector).
[url=http://www.fourhares.com]fourhares.com[/url]

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Mon Sep 07, 2009 8:23 am

Hi jmd,

to prevent further inconveniences, I would recommend that you open the Rev preferences and check "Property labels are: -> Name of revTalk property" :)

This way all the labels in the inspector will show the correct name of objects property!


Best

Klaus

jmd
Posts: 6
Joined: Tue Apr 11, 2006 12:15 am
Contact:

Post by jmd » Mon Sep 07, 2009 8:45 am

:oops: Thanks for that - seems so obvious once pointed out!
[url=http://www.fourhares.com]fourhares.com[/url]

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Tue Sep 08, 2009 11:56 am

It's not as obvious as all that! Don't worry about it. If you like having the "user friendly" description labels but still want to be able to tell what the property name in question is, alternatively you can also mouse hover over the property and the tooltip will show the property name for you.

Post Reply