Automatic scrolling of Text Entry field

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
tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Automatic scrolling of Text Entry field

Post by tasdvl9 » Wed Feb 12, 2014 4:00 pm

Hello,

I'd like my text entry field to automatically scroll after I import text into that control field.

Basically I am using wordlib to import a file. The file contents will be viewed in my text entry field.
I'd like a scroll bar to automatically appear when the text in the file is longer(more lines) than the size
of the control field. Is there a way of doing this?

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Automatic scrolling of Text Entry field

Post by FourthWorld » Wed Feb 12, 2014 4:37 pm

A request has been submitted for the engine to do this automatically for us:
http://quality.runrev.com/show_bug.cgi?id=7664

I suspect that'll be addressed when the team's work on the Cocoa build is done (good progress so far, but still some rough edges to address).

In the meantime, you can toggle the vScrollbar property based on whether the field's formattedHeight exceeds the object height, e.g.:

Code: Select all

on textChanged
  set the vScrollbar of me to (the formattedHeight of me > the height of me)
end textChanged
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

tasdvl9
Posts: 94
Joined: Fri Dec 06, 2013 3:55 am

Re: Automatic scrolling of Text Entry field

Post by tasdvl9 » Wed Feb 12, 2014 5:18 pm

Thanks!

Works like a charm :)

Post Reply