Scroller with dynamic content

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Pistris
Posts: 148
Joined: Mon Jul 20, 2015 2:40 am

Scroller with dynamic content

Post by Pistris » Thu Sep 19, 2019 6:28 pm

I have the need to create a scroller somewhat like a news feed
where I don't know before hand the amount of data that will be in it

in the past when I had this situation I created a webpage with the data
and loaded it using the web control

I can't use that method now since the app its going to be used mostly offline
and the data presented in the scroller is going to be already in the phone but
the order and the amount of data changes from time to time

any ideas on how to implement this?

thanks in advance.

Edd.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9660
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Scroller with dynamic content

Post by dunbarx » Thu Sep 19, 2019 8:41 pm

Hi.

When you say "scroller", do you mean a field with text that scrolls down automatically? That is easy. If you want something like a teleprompter, where the rate of scrolling is manually controlled, well, that is easy too.

Or something entirely different?

Craig

Pistris
Posts: 148
Joined: Mon Jul 20, 2015 2:40 am

Re: Scroller with dynamic content

Post by Pistris » Fri Sep 20, 2019 3:42 am

you have to scroll down yourself

the problem is I don't know how to calculate the total height of the scroller content beforehand since the
items in the scroller change

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9660
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Scroller with dynamic content

Post by dunbarx » Fri Sep 20, 2019 6:27 pm

Hmmm.

You know that you can always retrieve the number of lines in a scrolling field, right? And that you can retrieve the "scroll" of such a field. And that if you know the textHeight of the field, you can determine the relative "amount" of scroll that field currently exhibits, even on the fly.

But is that what you needed?

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9834
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Scroller with dynamic content

Post by FourthWorld » Fri Sep 20, 2019 6:40 pm

In the Dictionary see the unboundedHScroll and unboundedVScroll properties.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9660
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Scroller with dynamic content

Post by dunbarx » Fri Sep 20, 2019 7:56 pm

You can also use the "vScroll" property in a "scrollBarDrag" handler to see where you are in the scroll process. This value could be scaled in any way you desire.

Code: Select all

on scrollbarDrag
   put the vScroll of me
end scrollbarDrag
Craig

Pistris
Posts: 148
Joined: Mon Jul 20, 2015 2:40 am

Re: Scroller with dynamic content

Post by Pistris » Sun Sep 22, 2019 3:44 am

Thanks guys
Those suggestions actually resolved my problem

Thank you again

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”