What are hSscroll, vScroll really?

Graham Samuel livfoss at mac.com
Sat Dec 8 11:50:57 EST 2012


This is a comment that the LC documentation has not (yet) delivered the goods. I think there's a bit missing (I've tried the user guide, the release notes and the dictionary by searching for the words 'scrolling' and 'scroller').

In the LC dictionary, it says this about hScroll (the horizontal and vertical scrolls are the same in principle so I'll just quote the entry about h):

> The hScroll is the amount in pixels the object has been scrolled to the right. If the hScroll is zero, the object has not been scrolled.

Er yes, but what is the implied context here? If I create a group (or a field) and plonk it onto the middle of a card, can I make it move to the left or right by changing its hScroll, regardless of any other objects on the card? The answer is 'no' - but the LC docs doesn't explain the underlying context, so one can be left confused by this definition.

What is missing is the idea that a group (or a field) can be narrower (shorter) than the width (height) of its full contents, as recorded in its formattedWidth (Height). Meaningful scrolling can take place when this is the case in one or both dimensions, and it allows us to shift the contents of the object within a frame (which is its rect). It's pretty fundamental, but I just realised that I had never really understood it, which is why I looked in the LC docs for an explanation and couldn't find anything. Having understood it, I find it easier to understand where the implementation of scrolling in the iOS version of LC came from.

If I were really a newbie trying to understand LC, I think I would find this confusing. Does anyone agree that the docs could do with a bit more info about this?

Graham




More information about the use-livecode mailing list