Problems with aligning Morphs

Tim Rowledge tim at sumeru.stanford.edu
Tue Sep 11 05:15:53 UTC 2001


Now that I have the drag and drop part of my VMMaker UI working nicely,
I need to add the last few widgets. I though it would be easy...

Basically all I need is (roughly)
	label: [text field]
	label: [text field]
	label: [text field]
label		label		label
{list}		{list}		{list}
	button

I can make the
label
{list}
parts easily enough, and when simply inserted into a SystemWindow in
frames (ie sysWin addMorph: list&label-in-a-column frame:(0 at 0 extent:
1/3 at 1)) all is well.
Unfortunately, if I put all three into an alignmentMorph I lose the
function of the scrollbars and the colour is f^&$%^ed.

Attempting to make the
label: [text field]
bits has been impossible as well. Using an AlignmentMorph newRow seemed
an obvious start, but that makes a morph that is very high and no matter
what I tried I couldn't get the text field to be similar height to
the label, nor to spread out (using #spaceFill) to fill the width of the
parent.
Adding the sorry result to the system window in a frame made an even
bigger mess - it simply overflows the frame.

In experimenting to try to fix this I noticed some very odd seeming
behaviour.
Try:-
|a b|
a _ AlignmentMorph newRow.
b _ AlignmentMorph newColumn.
b addMorph: PluggableListMorph new.
b addMorph: PluggableListMorph new.
a addMorph: b.
a openInWindowLabeled: 'foo'

or how about:-

|a b|
a _ AlignmentMorph newRow.
b _ AlignmentMorph newColumn.
b addMorph: PluggableListMorph new.
a addMorph: PluggableListMorph new.
a addMorph: b.
a openInWindowLabeled: 'foo'

then what about:-
|a b|
a _ AlignmentMorph newRow.
b _ AlignmentMorph newColumn.
b addMorph: (PluggableListMorph new hResizing: #spaceFill; vResizing:
#spaceFill).
a addMorph: (PluggableListMorph new hResizing: #spaceFill; vResizing:
#spaceFill).
a addMorph: b.
a openInWindowLabeled: 'foo'

or even the simple:-
|a |
a _ AlignmentMorph newRow.
a addMorph: PluggableListMorph new.
a addMorph: PluggableListMorph new.
a openInWindowLabeled: 'foo'

Eek. I thought this was simple...

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Strange OpCodes: SSU: Screw the System Users





More information about the Squeak-dev mailing list