Scrolling to a clicked line when dontwrap=false

Tim Selander selander at tkf.att.ne.jp
Sat Aug 27 05:11:13 EDT 2011


I have a field full of (locked) text (a TV script), lines are 
wrapped. I want to be able to click a word in the text and 
automatically set the scroll of the field so that the line with 
the clicked word is at the very top of the field.

I can set the vscroll of the field using the number returned by 
(the clickline)*(the textheight) of the field. But, each wrapped 
line in the text above the click throws that calculation off...

How can I take the wrapped lines into consideration so that the 
text my users click pops to the top of the field?

Thanks,

Tim Selander
Tokyo, Japan




More information about the Use-livecode mailing list