[squeak-dev] Morph dragging code?

tim Rowledge tim at rowledge.org
Mon Jan 6 20:43:34 UTC 2014


On 05-01-2014, at 1:05 PM, karl ramberg <karlramberg at gmail.com> wrote:

> Most use of picking up a morph is in PasteUpMorph>>mouseDown:

Yah, I eventually found that. Definitely a serious lack of documentation here.

So far I’ve found the 
over-ride #mouseDown: and 
add an event handler for #startDrag
approaches


> 
> Easiest way to do drag and drop is to use a PasteUpMorph as a play field and use the already implemented drag and drop functionality.

The problem with that - and the PasteUpMorph subclass ‘PartsBin’ is that they are huge, heavy, complex classes with a lot of function completely irrelevant to what I want - and horribly not what I want to explain in a tutorial!

On 05-01-2014, at 2:40 PM, Chris Muller <asqueaker at gmail.com> wrote:

> There are several examples in the image, did you look at references to
> TransferMorph?

I saw TransferMorph; that’s an interesting oddity since they aren’t there until *some other* morph has created one as part of *its* drag handling. That changes what parts of the protocol are needed. 

> 
> Maui uses drag-and-drop extensively, you can load it from SqueakMap.

I knew that somewhere in the attic that is called my memory, but didn’t think of it as a source for examples. I’ll take another look.

It’s an interesting problem. Dragging is quite a bit more involved than the drop at the end, at least from the point of view of trying to explain it simply and provide small examples to illustrate.

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Oxymorons: Political science




More information about the Squeak-dev mailing list