Jacque.
Neither do I. Not sure anymore which handlers I have tried and which not. And your methodology is so compact and elegant. Craig on doScroll pNum put the formattedheight of line 1 to pNum of fld 1 into tScroll set the scroll of fld 1 to tScroll set the hilitedline of fld 1 to pNum end doScroll -----Original Message----- From: J. Landman Gay <[email protected]> To: How to use LiveCode <[email protected]> Sent: Tue, Nov 18, 2014 2:38 pm Subject: Re: Find the scroll location in wrapped field On 11/18/2014, 1:08 PM, [email protected] wrote: > I tried a bunch of stuff like that; your thinking seems sound. I > thought mine did as well. Sometimes it sets a line properly, and > sometimes, especially with small textSize lines near large ones, not > at all. In fact, several lines away. I am still not having any issues at all with this handler: on doScroll pNum put the formattedheight of line 1 to pNum of fld 1 into tScroll set the scroll of fld 1 to tScroll set the hilitedline of fld 1 to pNum end doScroll It places the correct line at the top, no matter which line is currently selected, and selects the designated line of the field. The thing that makes this work is that it does require having listbehavior set to true. Once that's done, the engine handles all the details without any trouble. Here is the handler I used to set up the field content. I add the line numbers so I can see whether the correct line does in fact get selected. on setup get the colornames repeat with x = 1 to the number of lines in it put x & space before line x of it end repeat put it into fld 1 repeat with x = 1 to the number of lines in fld 1 step 2 set the textsize of line x of fld 1 to random(40)+12 end repeat end setup -- Jacqueline Landman Gay | [email protected] HyperActive Software | http://www.hyperactivesw.com _______________________________________________ use-livecode mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list [email protected] Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
