AlignmentMorph and TextMorph

Andrew C. Greenberg werdna at gate.net
Sun Dec 27 18:33:03 UTC 1998


> [previous discussion snipped]
>
> OK - perhaps I simplified it too much.
> Attached is a small changeset that adds a HallOfFame class for
> recording top scores for games.  It has been spliced into Tim Olson's
> SameGame.  In the class comment for HallOfFame is some code that
> will display 4 rows of hall of fame with varying length strings for the 
> names
> and scores.
>
> The names are all left justified (expected), the scores are all
> right justified. (why?)
> The names are editable, the scores are not.  (why?)


Same answer as before -- if you look at the morphs in the world (open 
Drop'NDrag and start manipulating them), you'll see that you have three 
morphs in a box, two with text of fixed length, and one of varying size in 
between them that fills the rest of the space.  As noted, the text aren't 
justified in their respective boxes, they are moved to the outer corners of 
the box by the inside spacer.

As noted, for the phrase "justification" to mean anything with respect to a 
piece of text, you must specify also an area of (at least temporarily) 
fixed width in which the text is to reside.

Bob's example performs as indicated.





More information about the Squeak-dev mailing list