How to set a field in place with dragenter and a singleclick?

J. Landman Gay jacque at hyperactivesw.com
Sun Dec 18 22:53:19 EST 2005


William de Smet wrote:
> Hi there,
> 
> For my first app I am looking for a function where a field would  stick 
> to the mouseloc after a mouseclick and on the next mouseclick  to let 
> the field go (I work with disabled children so need to make it  as easy 
> as possible!)
> By accident (after playing with dragEnter) I got what I want but a  
> little thing still bothers me: with the script I got so far I need to  
> doubleclick to let the field go and put it in place. What I want is a  
> singleclick to make this happen.
> What do I need to do ?
> Below the script I use:
> 
> Stackscript:
> on dragEnter
> end dragEnter
> 
> Fieldscript:
> on mouseDown
>   grab me
>   set the layer of me to 100
>   set cursor to 28
>   lock cursor
>   set the dragdata["text"] to the short name of the target
> end mouseDown
> on mouseup
>   unlock cursor
>   set cursor to arrow
> end mouseup

This seems to work okay for me (Mac OS X), but if you are having trouble 
try putting the "grab" command as the last thing in your mousedown 
handler. That way everything in the handler will have already executed 
before the grab command takes over control of the mouse.

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



More information about the use-livecode mailing list