[Cuis-dev] [RFC][Proposal] A possible refactor of the Morph hierarchy

Juan Vuletich juan at jvuletich.org
Tue Oct 13 13:22:15 PDT 2020


On 10/13/2020 2:44 PM, Phil B via Cuis-dev wrote:
> Juan,
>
> Not wild about the StringMorph->LabelMorph idea... looks like 
> rearranging the lawn furniture to me as the existing name seems 
> accurate and clear.

Ok. Let's listen to other opinions. Leaving it like it is is also ok for me.

> Re: the rest, hopefully the final step would be to merge 
> RectangleLikeMorph and BorderedRect back into RectangleMorph and move 
> it to someplace like goodies.

I think we can do better than that. RectangleLikeMorph and BorderedRect 
can't be rotated, for instance. We'd include a basic library of vector 
graphics shapes to play with. We're slowly walking in that direction.

> The first question new users often have re: Morphic is 'how do I 
> instantiate or create my own Morph?' and a clean RectangleMorph would 
> provide that as a trivial Morph for instantiating and subclassing. 
> (i.e. rather than deprecating it and prolonging the confusion/pain, 
> keep a cleaned up version around specifically for tutorials/testing 
> where you don't have to worry about features creeping in over the 
> years breaking things)

I agree with the concern, but I don't like RectangleMorph or 
BorderedRectMorph for that. Squeak has a pretty nice set of morphs to 
play with. Cuis doesn't include them because they look ugly without a 
good vector engine, and because the implementation of scaling and 
rotation is not good enough. VectorGraphics allows to do all that and 
more, with nicer code and better looks.

> Also, make sure the widget class is explicitly documented as abstract 
> just like Morph should be (how many times have we had people confused 
> about why instantiating Morph has problems?)

But Morph, RectangleMorph and BorderedRectMorph, all can be instantiated 
and used. If something breaks, please tell.

>
> Thanks,
> Phil
>

Thanks,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich



More information about the Cuis-dev mailing list