[CONNECTORS] How to abort crosshair mode

Ned Konz ned at bike-nomad.com
Tue May 20 16:56:58 UTC 2003


On Monday 19 May 2003 02:13 pm, Martin Drautzburg wrote:
> Ned Konz <ned at bike-nomad.com> writes:
> > Sounds like a bug. Can you tell me why the connection is refused?

> Its owner (a "ProducContainer" - a PasteUpMorph) claims
>
> wantsAttachmentFromEnd: anEnd ofConnector: aConnector
> 	^ true
>
> isConnectable
> 	^ false

That's odd. #isConnectable is only called from 
#wantsAttachmentFromEnd:ofConnector:. You might want to look at the 
(somewhat lengthy) rules in #wantsAttachmentFromEnd:ofConnector: to 
see if you might want to be a bit more selective.

> isPlayfieldLike
> 	^ false

That's a bad idea. The problem is that this behaves like a playfield. 
When you click on it, the hand will drop the connector into the 
playfield. And then there's a test in #noteNewOwner: to see if it's a 
playfield. I admit that I should probably handle the event. Here's a 
FSM log when I click on one of these mutant playfields:

1903(unOwned) EV ownerChangedToHand #(a HandMorph(3205))
1903(unOwned) FSM newState: #(#draggingMorph) #(a HandMorph(3205))
1903(unOwned) NEWSTATE draggingMorph
1903(draggingMorph) CLIENT enterDraggingMorph #() #()
1903(draggingMorph) EV ownerChangedToHand #(a HandMorph(3205))
1903(draggingMorph) MISSED ownerChangedToHand #(a HandMorph(3205))
1903(draggingMorph) EV ownerChangedToHand #(a HandMorph(3205))
1903(draggingMorph) MISSED ownerChangedToHand #(a HandMorph(3205))
1903(draggingMorph) EV ownerChanged #(a TestPUM(2710))
1903(draggingMorph) MISSED ownerChanged #(a TestPUM(2710))

Is there some reason why you want to return false to isPlayfieldLike?
Why not just stick the playfield in another Morph and make that 
connectable?

> I hope I have put to gether all relevant parts. When I start
> dragging a connector (from the flaps) no line is drawn and I stay
> in crosshair mode forwever.
>
> It may have someting to do with the fact, that the connector has no
> obvious owner, it would have to strech from one owner
> (aProductContainer) to another owner (World). It would have to live
> "in the air". I am not really attempting to do this, but it happens
> accidentally and I cannot get out of it anymore.

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



More information about the Squeak-dev mailing list