seeking guidance on Layout
karl.ramberg at chello.se
Thu May 5 22:27:00 UTC 2005
Ross Boylan wrote:
>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?)
These settings are a little confusing, and some morphs override them
own policy, for example text morph. But some trial and testing should
to the wanted behaviour.
>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.
The table layout in Squeak is pretty basic and is hard to controll if
you want an exact layout.
Use proportional layout for anything you want to have controll over.
>Also, is there any functionality around that will make scrolling
>happen automatically if the mouse gets close to the edge of the pane?
Should not be hard to implement using mouseEnter or mouseOver events.
>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