porting 2.7 morph dragging to 3.1

Ned Konz ned at bike-nomad.com
Mon Jul 9 20:29:17 UTC 2001


On Monday 09 July 2001 12:10, you wrote:
> After reading Jim's excellent description and spelunking a bit around
> the code, it seems to me that my problem is actually not really in the
> realm of the current dragndrop world.
> So far as I can tell, dragndrop is setup to pick up a morph and drag it
> around as a 'picture' attached to the hand, then try to drop it wherever
> you let go. There appears to be no way to notify the morph you are
> dragging (or it's intended owner) at each step of the drag.

aboutToBeGrabbedBy: answers a Morph gets attached to the hand and dragged 
around. This is often the original Morph.

I had to add a notification at the end of Morph>>privateAddMorph:atIndex: 
that the owner had changed. That way, I could detect when my morphs had been 
grabbed by the hand or dropped on a PasteUpMorph.

> Maybe I simply need to handle mouseMove events or something like that?

Sounds like you could do what you need by overriding, say, changed and 
looking at your new bounds.

Or provide a step method that just looks at the position of the Morph and 
rearranges the lines (this is what my stuff does, except that the lines 
themselves are Morphs and they know what they're connected to).

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com




More information about the Squeak-dev mailing list