Showing linkText on mouse over

J. Landman Gay jacque at hyperactivesw.com
Fri Feb 24 15:59:08 EST 2006


Devin Asay wrote:
> I actually modified my handler to add an interrupt at the beginning:
> 
> on mouseWithin
>   if the mouse is down then exit mouseWithin ## interrupt this  handler 
> to pay attention to the mouse.
>   if the textStyle of the mouseText contains "link" then
>     put the linkText of the mouseText into fld "status"
>   else
>     put empty into fld "status"
>   end if
> end mouseWithin
> 
> It seems to be working reliably now. Anybody know of any reason why  
> this approach might be a bad idea? Sort of like how we've been  
> encouraged not to use things like 'wait until the mouseClick'?

The problem with polling the mouse repeatedly usually happens if you do 
it inside a repeat loop. There is no opportunity inside a loop for the 
CPU to do anything else, so all background processes come to a halt. In 
this case, "mousewithin" is sent by the engine and presumably allows 
time in between for background processes, so this method probably isn't 
too bad.

A "send in <time>" structure might be a marginally better approach 
anyway, because you could send the message at longer intervals than 
"mouseWithin" gets sent, allowing for more background time. But if you 
don't notice everything else on the computer grinding to a halt while 
your cursor is inside this field, then what you are doing is probably okay.


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



More information about the use-livecode mailing list