Scroll a field to a specified line number

Michael Lew michaell at unimelb.edu.au
Sun Aug 16 20:56:37 EDT 2020


This is an odd one, and I hope that it is a bug. When I try to scroll an ordinary text field to a specified line number it overshoots, and if I set the field to have list behaviour it overshoots by even more.

Here's a simple recipe. New stack with a field and a button. Button script is this:
on mouseUp
put empty into fld 1
repeat with i = 1 to 100
put i & return after fld 1
end repeat
set the vScroll of fld 1 to (60 * the effective textHeight of fld 1)
end mouseUp
Clicking the button takes me to line 65, and when I set the list behaviour to true the button scrolls me to line 69.

I would love a script that works, and this a big, right?

Michael


More information about the use-livecode mailing list