TableLayouts and TextMorphs

Jesse Welton jwelton at pacific.mps.ohio-state.edu
Wed Feb 21 22:05:05 UTC 2001


I've been wrestling recently with TableLayouts and TextMorphs.  The
problem is that TableLayouts don't work nicely with morphs which
dynamically resize in one direction based on changes made in the
other.  Specifically, the TextMorphs' height depends directly on their
width.  During layout, the LayoutCells are computed prior to setting
the submorphs' width, so TextMorphs with hResizing = #spaceFill and
their owners with vResizing = #shrinkWrap are not fitted correctly to
their cells.  This can also have an effect on siblings of the
TextMorph which have vResizing = #spaceFill (the owner has
rubberBandCells on).

Attached is a morph illustrating the problem.  It consists of a
RectangleMorph with three lines.  Each line is a RectangleMorph with a
green marker (a RectangleMorph) and a TextMorph.  Resize the whole
thing slowly.  When a TextMorph changes its height, the green markers
and the cell size for the line is wrong.

I've had little success fixing this behavior.  It definitely seems
that TableLayouts are better suited to objects which don't resize in
this way.  I'd hate to think how difficult it would be to solve this
in general for layouts with wrapping.  It seems reasonable instead to
define a TableLayout subclass which handles this, but is restricted to
simple columns and rows.  Even then, I'm running into problems.  (Even
forcing the layout to be computed twice only seems to work for the
rows, and not the columns.)

Does anyone have any suggestions or interest in working on this with
me?

-Jesse
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ResizingProblemDemo.morph.gz
Type: application/octet-stream
Size: 2458 bytes
Desc: 
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010221/f718d838/ResizingProblemDemo.morph.obj


More information about the Squeak-dev mailing list