Steve Thomas | 9 Feb 02:37

Droppable Behaviors in Etoys

I am looking to create droppable behaviors similar to those in Lively Kernal.  I can do it with connectors like this:

script1
self getDestinationPlayer setColor: self getSourcePlayer getColor

But would like to simply drop a morph onto another morph to accomplish the task.  How can I get a list of morphs my "droppable behavior" is overlapping?

Extra points for a sample project :)

Thanks,
Stephen 
_______________________________________________
squeakland mailing list
squeakland@...
http://lists.squeakland.org/mailman/listinfo/squeakland
K. K. Subramaniam | 9 Feb 16:32
Picon

Re: [etoys-dev] Droppable Behaviors in Etoys

On Thursday 09 Feb 2012 7:07:17 AM Steve Thomas wrote:
> I am looking to create droppable behaviors similar to those in Lively
> 
> Kernal.  I can do it with connectors like this:
> > script1
> > self getDestinationPlayer setColor: self getSourcePlayer getColor
> 
> But would like to simply drop a morph onto another morph to accomplish the
> task.  How can I get a list of morphs my "droppable behavior" is
> overlapping?
You can use Morph>>morphAt:behind:unlocked: method to get a list of morphs 
that lie below a morph at the given position.

The embed menu op uses this to extract a list of morphs. See 
Morph>>potentialEmbeddingTargets and its callers for examples.

HTH .. Subbu

Gmane