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

H. Hirzel hannes.hirzel at gmail.com
Tue Oct 7 09:24:40 PDT 2025


On 07/10/2025 12:01 pm, Juan Vuletich wrote:

> Unless someone corrects me, I believe you need to code that yourself.
>
>
For doing that I would need to calculate the necessary size of the 
submorphs and then set the size of the window s, e.g.

w morphExtent: 200 at 200.

to work but this does not work. What am I missing here?

------------------------

| 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 morphExtent: 200 at 200.
w openInWorld.






More information about the Cuis-dev mailing list