[Cuis-dev] custom morph confusion

Mark Volkmann r.mark.volkmann at gmail.com
Thu Jul 11 12:39:40 PDT 2024


When creating a custom morph it's not clear to me whether I should subclass
PlacedMorph or BoxedMorph.

I see that PlacedMorph doesn't hold the size of the morph, but BoxedMorph
does. BoxedMorph has the instance variable extent and the accessors
morphExtent and morphExtent:. I want to be able to set the extent of my
custom morph instances and utilize that size information in my drawOn:
method.

However, the drawOn: method in PlaceMorph uses a VectorCanvas and
BoxedMorph uses a HybridCanvas. HybridCanvas doesn't have the
strokeWidth:color:fillColor:do: method and I want to use that.

I could add my own extent instance variable to my PlacedMorph subclass, but
that feels wrong.

I need some advice on this.

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240711/48c94e29/attachment.htm>


More information about the Cuis-dev mailing list