[Q][BUG] Why rotated morph change class ?

Frank Caggiano frank at crystal-objects.com
Thu Sep 2 15:12:02 UTC 2004


On Sep 2, 2004, at 6:09 AM, Marcin Tustin wrote:

> On Thu, Sep 02, 2004 at 06:59:36AM -0300, Lic. Edgar J. De Cleene 
> wrote:
>>

>>
>> World submorphs do: [ :m| (m isKindOf: EllipseMorph ) ifTrue: [ m 
>> delete ].
>>
>> Guess what:
>>
>> The rotate one don't delete. I know what should be originate a
>> TransformationMorph , so I pick again via halo and raise a inspector.
>>
>>

>
>     While I do think it passing strange that rotation causes a 
> class-change
> (which I didn't realise was possible in Smalltalk), class-changing can 
> be
> extremely useful. For instance, it allows one to add new methods to an 
> object
> by creating a new class derived from the old class, then changing the 
> class
> of the object. Of course, naive use has problems, and smalltalk may 
> have
> better ways of doing that, but that is an example of a real use
>

What is happening is that the owner of the ellipse morph changes from 
the world to a transformation morph. The class of the ellipse morph is 
not changing.

To see this open an inspector on an ellipse morph and display the owner 
category. You'll see it's the world. Now rotate the ellipse, you'll see 
the owner change to a transformation morph.

regards




More information about the Squeak-dev mailing list