mouseEnter-Leave conundrum

J. Landman Gay jacque at hyperactivesw.com
Mon May 14 16:38:40 EDT 2007


Devin Asay wrote:

> If I just add an unlock messages line after the hide fld it pretty much 
> fixes it:
> 
> on mouseLeave
>  if the name of the target contains "graphic" then
>   lock messages
>   hide fld "myLabel"
>   unlock messages
>  end if
> end mouseLeave
> 
> The only problem left is a quick flash when I move between the graphic 
> and the overlapping field. Annoying, but livable.

It still fails if the user slides the mouse over the label and exits 
that way.

I might try something like this instead:

local sObj

on mouseEnter
   if the name of the target contains "graphic" then
     put the name of the target into sObj
   end if
end mouseEnter

on mouseMove x,y
   if sObj = "" then pass mouseMove
   if x,y is not within the rect of sObj then
     hide fld "field1"
     put "" into sObj
   else
     show fld "field1"
   end if
end mouseMove

If your label fields are systematically named for the objects they 
identify then it shouldn't be too hard to figure out which label to hide.

You don't need a "mouseLeave" with this method.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list