More send in time

Geoff Canyon gcanyon at inspiredlogic.com
Mon Jun 30 23:41:00 EDT 2003


On Monday, June 30, 2003, at 08:21  AM, Ken Norris wrote:

> on mouseDown
>   repeat until the mouse is up
>     if the mouse is within graphic 1 then
>        set the vScroll of fld 1 to (the vScroll of fld 1) - 1
>     else beep
>   end repeat
> end mouseDown

Use the mouseStillDown message, which is custom configurable based on 
the idleRate and idleTicks properties.

Something like:

on mouseDown
   scrollTheField
end mouseDown

on mouseStillDown
   scrollTheField
end mouseStillDown

On Monday, June 30, 2003, at 04:11  PM, Ken Norris wrote:

> These two lines of your script defeat my purpose for using the 'send in
> time' construct, because they still use 'the mouse', which I'm trying 
> to
> avoid:
> ----------
>> if the mouse is up then exit checkScroll
>> if the mouse is within graphic 1 then

The problem isn't the use of the mouse function, or the mouseLoc 
function; it's with this:

repeat while the mouse is "down"

Just querying the mouse in a handler that is calling itself (by using 
send in) every few ticks is fine. Using repeat while the mouse... leads 
to hogging system resources unnecessarily and possibly wrong results.

I hope this helps. Feel free to contact me if you have any further 
questions.

regards,

Geoff Canyon
gcanyon at inspiredlogic.com




More information about the use-livecode mailing list