seeking guidance on Layout

Ross Boylan RossBoylan at
Wed May 4 15:25:00 UTC 2005

I have a Morph I'll call Inner that holds a bunch of boxes arranged in
columns.  The number of boxes is large enough that they won't all fit
on the screen.  I'd like to embed this in a TwoWayScrollPane.

Getting the right sizing information communicated properly has proven
trickier than I thought, and I'd appreciate any advice on how to
proceed.  The ownership of the Morphs looks like this, with owners
above the things they own:

addMorph:frame:  (I'm doing this from memory, so details may be off)
works to embed the TwoWayScrollPane in the SystemWindow, but the
resizing doesn't get transmitted further than that.  The proximate
cause seems to be that neither TwoWayScrollPane nor TransformMorph
have a layoutPolicy.  That's sensible, given their regular use.

However, I want one dimension of Inner to match the available space
(in this case, the vertical dimension).  What is a good way to achieve
this?  I think one way of putting that is that Inner's vertical should
spacefill and the horizontal should shrinkWrap.  (Hmm, can I just
combine those two?)

My current thinking is that I should make a custom LayoutPolicy, but
it looks as if I'd need to put one on both TwoWayScrollPane and
TransformMorph.  Also, I wonder if a regular TableLayout would do,
since the behavior I'm currently seeing suggets that TableLayout
matches the available dimension along its primary direction, and then
wraps with as much space as it needs in the other direction.

Also, is there any functionality around that will make scrolling
happen automatically if the mouse gets close to the edge of the pane?

I'm using TwoWayScrollPane because I'm in a 3.6 image; I'm aware it's
basically obsolete in 3.7.


More information about the Squeak-dev mailing list