[Cuis-dev] LayoutMorph and handling layouts

Juan Vuletich juan at jvuletich.org
Mon Oct 25 13:05:53 PDT 2021

Hi Eric,

Just added a working #new to LayoutMorph.

Thnaks for reporting!


On 10/24/2021 9:20 PM, Eric Gade wrote:
> Hi Juan,
> Thanks for the information. I'm still a little confused about one part:
> On Sun, Oct 24, 2021 at 11:48 AM Juan Vuletich <juan at jvuletich.org 
> <mailto:juan at jvuletich.org>> wrote:
>     > You might be thinking, "just use a LayoutMorph as the root,
>     Yes. That would be my suggestion.
>     > " which leads me to my next question: are we supposed to subclass
>     > LayoutMorph and use it by ourselves to make widgets?
>     No. there's no need to do that.The system uses instances of
>     LayoutMorph
>     all over the place. You can cycle the halo on any SystemBrowser, or
>     explore the submorphs structure and see for yourself.
> I'm probably not understanding some part of your explanation.
> I'll explain what I'm thinking. In order to create, say, a custom 
> Morph class that can also have layouts, I don't see a way around 
> subclassing LayoutMorph. The problem I encounter there is that the 
> normal Morph instantiation behavior of MyCustomMorph class >> #new no 
> longer works. The examples on the class side of LayoutMorph are not 
> useful in this case, since they are simply opening LayoutMorphs in the 
> world. My assumption about how we expect to initialize custom Morphs 
> in Cuis might be wrong -- maybe we shouldn't expect to be able to 
> `SomeMorph new openInHand` on every Morph subclass?
> You might be wondering why I would want to subclass. Having a complex 
> Morph with an override of #drawOn: so that there are rounded, clipped 
> corners is one example (attached is an image of the Morph I've been 
> able to make).
>     But, for example, SystemWindow does what you say. See
>     #layoutSubmorphs.
> Ok I'll look into this next.
> -- 
> Eric

Juan Vuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20211025/fcb78313/attachment.htm>

More information about the Cuis-dev mailing list