[Cuis-dev] LayoutMorph separation

Mark Volkmann r.mark.volkmann at gmail.com
Tue Aug 13 17:01:03 PDT 2024


On Tue, Aug 13, 2024 at 9:18 AM <ken.dickey at whidbey.com> wrote:

> On 2024-08-12 17:01, Mark Volkmann via Cuis-dev wrote:
>
> > I seem to keep running into situations where I want separation in a
> > LayoutMorph to only be added between the submorphs and not before the
> > first and after the last. I see that I can achieve that by modifying
> > the LayoutMorph method layoutSubmorphsHorizontallyIn:. But I don't
> > always want that behavior. I'd like that to be configurable. Is there
> > already a way to do this that I'm missing?
>
> No.
>
> I already suggested one way to do this.
>

I'd rather not have to insert spacer morphs, especially if there are a
large number of submorphs.
I attached my solution which is to create a subclass of LayoutMorph that
adds a boolean instance variable "trim".
When that is true, it avoids adding separation before the first and after
the last submorph.
This works for my use cases.
It would be great if this was added to LayoutMorph. It wouldn't affect its
current behavior.

-- 
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240813/03883e41/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Layout2Morph.st
Type: application/octet-stream
Size: 3347 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240813/03883e41/attachment.obj>


More information about the Cuis-dev mailing list