Pseudo Drag and Drop question

Jerry Balzano gjbalzano at
Wed Feb 23 16:22:06 CST 2005

OK, on further review ...

The maneuver suggested by David Epstein, although it seemed promising at
first, won't work.  The only way the mouseEnter message gets triggered by
the "receiving" object is (a) if the mouse button is up, and (b) if the
moving control is in a layer *beneath* the receiver (else the receiver
doesn't "see" the cursor).  The documentation on "mouseEnter" verifies all
this.  Since (b) one would generally want to "set the layer to top" for
any "dragged" control, and (a) one would generally have the mouse button
down in such situations, we are double-damned.

So I am back to thinking that in order to have Rev do what I want, i.e.
have any  potential drop locations hilight as soon as the dragged object
(or the pointer) overlaps (enters) its rectangle, I believe I need to (p)
manage a list of potential target-controls and (q) iterate over it until I
find one with the mouseLoc (or some such) enters the rect of it.

I mainly want to know, am I right about this, that there is no easier or
better way?


> Somehow my ability to post to the Rev list has gotten messed up, but your
> question intrigued me.  I don't know exactly what handlers you're trying
> to use, but this simple test was encouraging:
> Make two buttons.  One has the script
> on mouseMove
> set the loc of me to the mouseLoc
> end mouseMove
> The other has the script
> on mouseEnter
> put "BINGO"
> end mouseEnter
> It appears that the second button receives the mouseEnter message even if
> the first button is being dragged around with the cursor (though it's
> triggered when the cursor arrives, not when the edge of the first button
> arrives).
> Hope this helps.
> David Epstein

More information about the use-livecode mailing list