[Cuis] Copy vs Clone

Dan Norton dnorton at mindspring.com
Wed May 13 20:19:56 CDT 2015


On 13 May 2015 at 15:41, Ken.Dickey wrote:

> I am seeing a strange behavior.
> 
> The simple way to see it is to make a child class of PartsBinMorph. 
> Call it, say, PartsBinTestMorph.
> 
> Add a method #PartsBinTestMorph>>
>   aboutToGrab: aMorph
> 
> 	^aMorph clone "parent has aMorph copy"
> 
> WHen I obtain a PartsBinMorph from the new morph menu, then add,
> say, a ellipse morph, I get the expected behavior.  WHen I "drag the
> ellipse out", the hand gets a copy of the ellipse and the original
> ellipse remains where I can see it.
> 
> But doing the same thing in a PartsBinTestMorph, I appear to grab
> the ellipse.
> 
> Now it turns out that the original ellipse is still a submorph of
> the PartsBinTestMorph, but it's morphPosition seems to be set to
> some random value.
> 
> I tried saving the original morphPosition, doing the clone, then
> resetting the saved morphPosition, but this does not change
> anything.
> 
> Unfortunately, my copy of the blue book is saved in a box somewhere
> (I am moving), so I don't have a spec for #clone.
> 

Searching my copy of BlueBook.pdf for clone comes up empty.

 - Dan




More information about the Cuis mailing list