[Cuis-dev] LayoutMorph example7 - how to constrain the size of SystemWindow object

H. Hirzel hannes.hirzel at gmail.com
Mon Oct 6 15:12:22 PDT 2025


P.S. What I mean is, how do I constrain the size of the SystemWindow object
without hard coding the extent as in the answer to Hilaire's mail.

On Tue, Oct 7, 2025 at 12:09 AM H. Hirzel <hannes.hirzel at gmail.com> wrote:

> Hi
>
> In the LayoutMorph example7 the size of the SystemWindow object is too
> large.
>
> How do I constrain the size of it so that it has the size as required by
> the morphs it contains?
>
> This is in recent Cuis 7.5-7635
>
> Kind regards
> Hannes
>
> -----------------------------------------------------------------------
> The updated example: It now shows the color given by the hex code but the
> window size is too large
>
> | c colorHexValue colorName r w colorHexValueLabel |
> w := SystemWindow new setLabel: 'Color'.
> r := LinearLayoutMorph newRow separation: 30 @ 10.
> c := LinearLayoutMorph newColumn separation: 20 @ 10.
> colorHexValue := '#FF00FF'.
> colorHexValueLabel := LabelMorph contents: colorHexValue .
> colorName := LabelMorph contents: 'magenta'.
>
> r addMorph: colorHexValueLabel.
> r addMorph: colorName.
> c addMorph: (ColoredBoxMorph new color: (Color fromHexString:
> colorHexValue)).
> c addMorph: r.
> w addMorph: c .
> w openInWorld.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20251007/564052bb/attachment.htm>


More information about the Cuis-dev mailing list