Testing over the years Pharo 1.4. I think it’s better to explain this using screenshots, the code below.
This is my initial state (what I am getting now with my code):

I want the group field morph to be filled horizontally when opened, for example:

And after resizing, I want group morphing to keep borders, i.e.:

This is the code I tried:
| s morph1 morph2 row groupBox scroller |
s := ScrollPane new.
morph1 := BorderedMorph new.
morph2 := BorderedMorph new.
row := UITheme builder newRow: {morph1 . morph2}.
groupBox := UITheme builder newGroupbox: 'Group Box Test' for: row.
groupBox
layoutFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @ 0.8));
vResizing: #spaceFill;
hResizing: #spaceFill;
layoutChanged.
scroller := s scroller.
scroller
addMorph: (groupBox position: 0@0)
fullFrame: (0 @ 0 corner: 0.8@0.5).
s scroller color: Color white.
s
extent: 250@150;
openCenteredInWorld
The container must be a ScrollPane.
I adapted the Bert code to not use the Polymorph UIBuilder, resulting in:
morph1 := Morph new.
morph2 := Morph new.
row := ScrollPane new.
row
color: Color white; borderColor: Color gray; borderWidth: 1;
layoutPolicy: ProportionalLayout new.
row scroller
addMorph: morph1 fullFrame: (LayoutFrame fractions: (0@0 corner: 1@0) offsets: (5@5 corner: -60@45));
addMorph: morph2 fullFrame: (LayoutFrame fractions: (1@0 corner: 1@0) offsets: (-50@5 corner: -5@45)).
row
extent: 250@150;
openInHand
but also does not work, because the inner blue morphs overlap and do not fill the specified frame. I tried many combinations using frames, but so far nothing has worked. Do you know what I am missing?
source
share