TextMorph (was Re: Editing an UpdatingStringMorph)

Ross Boylan RossBoylan at stanfordalumni.org
Mon May 21 04:49:49 UTC 2001


Thanks for the fish.  It seems to help.  I also find that I need to prefill 
the text morph with text of an appropriate length to get the paragraph to 
take the right width.  If I just use an empty string for contents, each 
letter I type appears on a new line (though in the right order).  I've not 
been able to set the right dimensions using extent:, bounds:, or other 
manipulations (that is, those commands don't enlarge the typeable area).

Some of the other solutions didn't seem to help much.  The TextMorph 
already has hResizing #rigid.  Enclosing it in a rigid alignment morph kind 
of worked.  I ran into some problems with that approach, but I think they 
are the same as those discussed in the previous paragraph.,

For everyone's reference, here's a little more on how the TextMorph 
operates:  The text being edited is stored in the paragraph instance 
variable (class NewParagraph).  When needed, an editor (class 
TextMorphEditor, a subclass of Controller, but not a Morph itself) gets 
added.

These different entities affect each other in ways that are not so clear, 
at least to me.  These in turn interact obscurely with the TableMorph.  For 
example, the StringMorphs, but not the TextMorphs (as I recall) expanded 
the row height in the table by 2 pixels every time I clicked on them.  So 
several clicks would really expand the height of the table.  I overrode the 
default row height specification, along with some other things in 
TableMorph, and now the rows don't grow vertically.


   At 08:09 AM 5/19/01 -0400, Jesse Welton wrote:


>And here's the fish.  It's small, but tasty: A tiny fix to save the
>editor information in TextMorph>>extent:, which I believe was
>responsible for losing this information when typing into TextMorphs in
>dynamic layouts.  Thanks for the hint, Dan!
>
>-Jesse
>





More information about the Squeak-dev mailing list