use-revolution Digest, Vol 55, Issue 25
Peter Brigham
pmbrig at gmail.com
Sun Apr 13 12:26:34 EDT 2008
On Apr 12, 2008, Colin Holgate <coiin at rcn.com> wrote:
> It's easy to show the problem:
>
> on dragStart
> set the dragData["text"] to the dragData["text"] && "hello"
> --pass dragStart
> end dragStart
>
> No matter what you drag, it should get there as the data plus "hello".
> As shown above it gets there as " hello", a space followed by hello.
> If you uncomment out the pass line, then the original dragdata text
> gets there ok, but it doesn't have hello attached.
>
> I haven't figured out a solution yet.
Well, this is really weird. I tried your script just as you have it
above and got the same thing as you -- " hello" and without passing
dragStart. So "get" the dragData failed (returned empty) but the
"set" worked fine. So I tried
set the dragData["text"] to the selectedtext && "hello"
instead, and got the proper result. (Yesterday I couldn't set the
dragData at all...?)So I have a workaround at least. However, if I do
the same script with passing the dragStart the result is a *move* of
the selected text as is. It now appears that I can "set" the dragData
in a dragStart handler -- as long as I don't pass dragStart -- but I
can't "get" it. Conversely, in a dragEnter or dragDrop handler in my
target field, I can *get* the dragdata but I can't *set* it.
I do have my workaround, but I'd love it if someone else can
experiment with the various permutations of dragstart in f1 vs
dragEnter or dragDrop in f2, with or without passing the commands.
There sure seems to be something odd going on here....
Peter M. Brigham
pmbrig at gmail.com
More information about the use-livecode
mailing list