Connectors help needed

Ned Konz ned at squeakland.org
Sat Dec 25 09:29:01 UTC 2004


On Friday 24 December 2004 10:23 pm, Michael Latta wrote:
> I am trying to do Ports.  These are shapes attached to the edges of
> shapes, that then can have connections to them.  I want to be able to
> drag them to different parts of the shape edge they are on, or to the
> edge of a different shape, and have them move to that shape.  If they
> get left in free space, they should snap back.  Possibly they should
> only snap back if within some proximity, or they should provide
> feedback like connection ends do to make it clear if they are
> attaching.  I guess I need to look at the connection more for that

Then why are you using constraintMorphs? If they're going to have connections 
to them (which are implemented using constraintMorphs), why would you need 
the dynamic re-positioning of the constraintMorph in the connection target as 
well?

Take a look at the Squeakland image to see where Connectors 2 is now (I know, 
I've got to get a 3.8 version out!). I've added support for connection to 
submorphs that have the #wantsConnectionWhenEmbedded property set. So you 
don't have to do anything special to make ports. Just embed submorphs with 
that property. They don't even have to be anything special or have any 
special behavior.

-- 
Ned Konz
http://bike-nomad.com/squeak/



More information about the Squeak-dev mailing list