[ENH] Re: TableLayouts and TextMorphs

Jesse Welton jwelton at pacific.mps.ohio-state.edu
Thu Feb 22 15:04:28 UTC 2001


On Wed, 21 Feb 2001, I wrote:
> 
> 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.  [Blah blah blablah blah...]

> 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.  [Blablah blah blah.  Help me Obi Wan Kenobi, you're my
> only hope.]

It's amazing how sometimes just phrasing the problem the right way can
really put you on track to find a solution.  I've defined
DynamicTableLayout as a subclass of TableLayout and successfully made
it aware of morphs which may resize themselves dynamically in response
to layout changes.  It only handles single rows and single columns (no
wrapping), and currently only with #leftToRight and #topToBottom
listDirections.  Also, the only dynamic morphs recognized so far are
TextMorphs and their owners with #shrinkWrap constraints.

In order to make this work in scrolling lists, I also made the minor
changes necessary to support layout within a TransformMorph.  I
believe this is a good step on the way to making it easier to define
widgets like the PluggableTextMorph which resize their scroll pane
contents, and to make adjustments to the three pixel horizontal inset
which is hard-coded in ScrollPane.

Attached are three files, as follows:

DynamicTableLayout.1.cs.gz -- the layout enhancements.

LayoutDemoWindow.morph.gz -- a SystemWindow with a ScrollPane
demonstrating how nicely this works.

ScrollingEnh.1.cs.gz -- an enhancement to scrolling behavior which
makes ScrollPanes more responsive to changes in their scrollRange.
(Try making large width changes to the demo window above, with and
without this changeset.  Without it, the ScrollBar's step size and
positioning can be very wrong.)  It also tidies up the xxxScrollRange
methods to be a little more logically consistent and makes some subtle
cosmetic changes.

Feedback appreciated.

-Jesse
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DynamicTableLayout.1.cs.gz
Type: application/octet-stream
Size: 2280 bytes
Desc: 
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010222/05bfc9cd/DynamicTableLayout.1.cs.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LayoutDemoWindow.morph.gz
Type: application/octet-stream
Size: 5128 bytes
Desc: 
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010222/05bfc9cd/LayoutDemoWindow.morph.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ScrollingEnh.1.cs.gz
Type: application/octet-stream
Size: 1250 bytes
Desc: 
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010222/05bfc9cd/ScrollingEnh.1.cs.obj


More information about the Squeak-dev mailing list