[Cuis-dev] LayoutMorph example7 - how to constrain the size of SystemWindow object
Juan Vuletich
juan at cuis.st
Tue Oct 7 10:35:08 PDT 2025
openInWorld first, then set morphExtent:
On 07/10/2025 1:24 PM, H. Hirzel wrote:
> 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.
>
>
>
>
--
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
More information about the Cuis-dev
mailing list