Highlight list line on hover?

Nonsanity form at nonsanity.com
Thu May 12 11:02:34 EDT 2011


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


On Thu, May 12, 2011 at 8:52 AM, Keith Clarke <
keith.clarke at clarkeandclarke.co.uk> wrote:

> Hi folks,
> I've found mouseEnter, mouseLine and Highlight in the dictionary but can't
> seem to get the syntax correct to highlight a line in a list field with a
> mouse hover, rather than a click.
> Any clues would be greatly appreciated.
> Best,
> Keith..
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list