Problem with mouseMove
James Hurley
jhurley0305 at sbcglobal.net
Wed Mar 11 11:00:49 EDT 2009
I have been trying to construct a pen-drawing stack that allows me to
paint kaleidoscopic figures--without success. (I am able to DRAW them.)
But Bernd Niggemann has found a way that works wonderfully well.
But I need to understand the difference. It appears that one cannot
use the MouseMove handler in conjunction with the line tool.
Here are two card scripts:
1)
local myName, tOldLOc
on mouseDown
put the name of me into myName
put 100,100 into tOldLOc
choose the line tool
end mouseDown
on mouseMove x,y
if myName is "" then exit mouseMove
drag from tOldLoc to x,y
put x,y into tOldLoc
end mouseMove
on mouseUP
put "" into myName
choose the browse tool
end mouseUP
2)
local tOldLOc
on mouseDown
put 100,100 into tOldLOc
choose the line tool
send "moveMe" to me
end mouseDown
on moveMe
if the mouse is up then
choose browse tool
exit moveMe
else
put the mouseloc into tNewLoc
drag from tOldLoc to tNewLoc
put tNewLoc into tOldLoc
send "moveMe" to me in 1 millisec
end if
end moveMe
This second script (essentially Bernd Niggemann's) works and the
first (mine) does not, in fact, Run Rev locks up and I need to force
quit.
In my mind the second script, using "moveMe" appears to simply roll-
your-own mouseMove handler by calling itself and getting the mouseLoc.
But it appears that mouseMove is not functional when using the curve
tool. Am I interpreting this correctly? What is there about the
mouseMove handler that I am missing?
Jim Hurley
More information about the use-livecode
mailing list