[CONNECTORS] How to abort crosshair mode

Ned Konz ned at bike-nomad.com
Tue May 20 18:24:14 UTC 2003


On Tuesday 20 May 2003 11:39 am, Martin Drautzburg wrote:
> Ned Konz <ned at bike-nomad.com> writes:
> > Is there some reason why you want to return false to
> > isPlayfieldLike?
>
> What I was trying to achieve is having a morph ("ProductMorph")
> inside a container (PasteUpMorph subclass "ContractMorph"). I want
> to be able to connect both the ProductMorphs and the Contracts.
>
> While this would still be nice to have, my main concern it: how to
> I get out of the crosshair mode.

brute force works:

NCConnectorMorph allSubInstancesDo: [ :c | c stopMonitoring ].
NCHighlightMorph allInstancesDo: [ :h | h delete ].

> > Why not just stick the playfield in another Morph and make that
> > connectable?
>
> I don't quite understand the semantics behind it. Why can't I
> simply connect a playfield. By sticking the playfield into another
> Morph it looks I supply a missing bit of information. What is this
> ?

The problem is that there is logic in connectionTargetsAt:for: that 
will stop looking at playfields. But then you drop the connector into 
the playfield anyway, and the connector misses this event, since it's 
expecting to be dropped into a playfield. I can fix this, but I won't 
be able to get to this till sometime next month.

Plus you'll confuse other logic in the system that uses 
#isPlayfieldLike.

Trust me: it's very simple to make your ContractMorph just a regular 
or BorderedMorph and stick a PasteUpMorph into it. It'll work much 
better.

> BTW the owner chain looks like this:
>
> ProductMorph (CircleMorph)
>         ContractMorph (PasteUpMorph isPlayfieldLike->false
>         			wantsAttachement...->true)
>                 ContractContainer(Rectangle) (isConnectable->false)
>                         SchemeView (PasteUpMorph)
>                                 World (PasteUpMorph)
>
> The connection points I see are from the ContractMorph.

-- 
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE



More information about the Squeak-dev mailing list