Page 1 of 1

Automatic scrolling of Text Entry field

Posted: Wed Feb 12, 2014 4:00 pm
by tasdvl9
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?

Re: Automatic scrolling of Text Entry field

Posted: Wed Feb 12, 2014 4:37 pm
by FourthWorld
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

Re: Automatic scrolling of Text Entry field

Posted: Wed Feb 12, 2014 5:18 pm
by tasdvl9
Thanks!

Works like a charm :)