ambassador at fourthworld.com
Wed Feb 16 16:32:06 CST 2011
J. Landman Gay wrote:
> On 2/16/11 11:37 AM, dunbarx at aol.com wrote:
>> I remember something about this early in my LC career. I want to
>> lock-step scrolling among a dozen or more fields.
>> The scrollBarDrag message in one field does the trick:
>> on scrollbarDrag
>> lock screen
>> repeat with y = 3 to 15
>> set the scroll of fld y to the scroll of me
>> end repeat
>> unlock screen
>> end scrollbarDrag
>> But is this the best way?
> Make the fields non-scrolling, group them, and set them all to the
> formattedheight of the longest one. (You may need to realign the tops.)
> Set the group to use a vertical scrollbar, and it will scroll all the
> fields automatically without any scripts. It's also a little smoother
> and more efficient than the scripted method.
The problem with relying on the group is that groups and fields and any
other objects in LC are limited to a formattedWidth and formattedHeight
of about 32k pixels.
There's a request to enlarge that:
But with that limitation, you can only display fields at their full
formattedHeight when their total content renders less than 32k px.
In contrast, the scrolling field object does a remarkable job in
smoothly handling about as much data as you can put into it (the
physical limit is 4GB and I've never had the patience or the RAM to test
that, but I have put in >1GB and while it takes several seconds to
render once it's up it works beautifully).
So until object sizes get increased, unless you know the text being
displayed will be relatively short you may be better off with the extra
time spend scripting the synched scrolling of multiple fields (or
perhaps concatenating the text into columns in a single field).
LiveCode training and consulting: http://www.fourthworld.com
Webzine for LiveCode developers: http://www.LiveCodeJournal.com
LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
More information about the use-livecode