LoFPlayer -- Apparent Connectors bug ...

Art Collings otter at mac.com
Fri Feb 18 06:36:12 UTC 2005


On Feb 17, 2005, at 2:16 PM, Ned Konz wrote:

> On Wednesday 16 February 2005 6:38 pm, Art Collings wrote:
>> Oh ... FYI, in writing the below, I used Connectors2 extensively. I
>> noticed the following apparent bug:
>>
>> 1. Place a Connector in a pasteUpMorph / playfield .
>>
>> 2. Move the playfield -- everything works fine, the Connector stays in
>> place in the playfield.
>>
>> 3. Move one of the ends of the Connector.
>>
>> 4. Now when the playfield is moved, the Connector drops down to the
>> world below.
>>
>> A number of variations on this theme cause similar behaviour, all
>> related to dragging the lineEndConstraints which then are apparently 
>> no
>> longer owned by
>> the playfield. This behaviour occurs (relatively harmlessly) in my
>> application which has subclassed Connectors, and also in the
>> non-subclassed  variety.
>
> Ordinarily, you'd have the connector actually attached to something. 
> The
> ownership of a Connector is usually the innermost PasteUpMorph that 
> contains
> (possibly indirectly) the morphs that the Connector is attached to.

Definitely, there isn't much point to having connectors that aren't 
connected to anything. In the process of using them though, sometimes 
it's convenient to disconnect them for a while at certain intermediate 
points.

>
> Because I never really worried about the ownership of connectors that 
> weren't
> attached to anything, it's probable that I made a mistake in assigning
> ownership on dropping the ends.


>
> The ownership of Connectors is an interesting problem. Because they can
> connect morphs which are owned by different parents (for instance, 
> connecting
> morphs that are in two different PasteUpMorphs), I have to find an
> appropriate parent for the Connector itself. If I choose the wrong 
> one, the
> Connector disappears behind something. So I chose the rule described 
> above:
> that the owner of a Connector is the innermost PasteUpMorph that 
> contains
> (possibly indirectly) the morphs that the Connector is attached to.

  I sensed it was the ownership issue was probably pretty complicated.

For what it's worth, my thought is what's desirable is to have the 
ownership behavior run along these lines:

<Event 'Move End Constraint' > results in 'EndConstraint being 
connected'
	ifTrue: [ New Owner = innermost pasteUpMorph owning the morph to which 
that End is now connected ]     " i.e. exaclty as now"
	ifFalse: [ NewOwner = Old Owner ]. 					"suggested refinement" 		

Keeping perspective -- this is a pretty small point, given that it 
isn't too hard to make sure connectors are connected to something, and 
especially given that Connectors are extremely cool, work great, and 
saved me countless hours in writing my little application!
	
>
> -- 
> Ned Konz
> http://bike-nomad.com/squeak/
>
>

- Art




More information about the Squeak-dev mailing list