*ListMorphs

Tom Rushworth tbr at mannynkapy.net
Wed May 7 00:41:17 UTC 2003


On Tue, May 06, 2003 at 05:26:14PM +0300, Lex Spoon wrote:
> tbr at mannynkapy.net (Tom Rushworth) wrote:
[snip]
> > While we're on the subject of ListMorphs, all of the list morphs seem
> > to expect the submorphs to be string/text morphs, and seem to provide
> > the submorphs with (effectively) infinite width.  I want to display a
> > list of more complicated morphs where each submorph is a window with
> > 3 (or more) panes.  I want the submorphs to be laid out proportionally
> > in the horizontal direction, but to be fixed size and scrolled in the
> > vertical direction.  (For anyone who has used Quicken, think of how the
> > list of transactions in an account is displayed.)
> > 
> > I just got such a morph working yesterday, but I had to make changes
> > all over the place :(.  Now that I've proved to myself I can do it :),
> > I can ask the list: is there an obvious, easy way to do this?  One that
> > doesn't involve a dozen new classes and changes to many old classes?
> > 
> 
> How about ScrollPane plus a table layout that is 1 column wide?  Maybe
> that would work.

A table layout is something I didn't think of trying.  I'll give it a try
as soon as I can get back to Squeak.

I suspect there will be problems though, because what I first tried was a
ScrollPane with a custom layout.  The ScrollPane's scroller is normally a
TransformMorph, and seems to intercept any layout stuff before it gets to
the morphs to be transformed.  I ended up replacing the TransformMorph
with a subclass of ComponentLikeModel that I called VerticalOffsetMorph,
which contains just enough of the TransformMorph to track a vertical offset,
and draw its submorphs accordingly.  The custom layout I called a
HorizontalProportionalLayout, and it's a fairly obvious subclass of
ProportionalLayout.  I was hoping I wouldn't need either one of them, but...
> 
> -Lex
> 
I need to get it cleaned up and posted, so people can criticize properly :).

-- 
Tom Rushworth



More information about the Squeak-dev mailing list