Highlight list line on hover?

Keith Clarke keith.clarke at clarkeandclarke.co.uk
Thu May 12 11:56:35 EDT 2011

...thanks Chris - I've added the screen lock/unlock (another first!), but I don't need to worry about long lines, because the list text Card names need to be visible in a fixed-width sidebar with no horizontal scrolling. 

So, I have...

on mouseMove
   lock Screen
   set the hilitedlines of me to (word 2 of the mouseline)
   unlock Screen
end mouseMove

Oh, and this behaves itself nicely in a list field with empty space at the bottom.


On 12 May 2011, at 16:02, Nonsanity wrote:

> select line (word 2 of the mouseline) of me
> That should work regardless of list behavior being on or off. If you use a
> mousewheel while hovering, the selection won't move until you move the mouse
> a little. I was tempted to add the same line to a scrolldrag handler, but
> that went crazy when the mouse was at the bottom of the field (causing a
> partially visible line to be selected and scrolled into view... recursion).
> So don't. :)
> If that was really a problem, you COULD add the scrollDrag handler, but
> would have to check the lines being selected and make sure it doesn't
> recurse... Or just check for recursion and exit.
> With non-list fields, if the line is longer than the width of the field, it
> will scroll horizontally to the end. You'll need to do this;
> on mousemove
>   lock screen
>   select line (word 2 of the mouseline) of me
>   set the hscroll of me to 0
>   unlock screen
> end mousemove
> The lock screen prevents a flicker.
> ~ Chris Innanen
> ~ Nonsanity

More information about the use-livecode mailing list