Word processing in Squeak?

Lex Spoon lex at cc.gatech.edu
Wed Feb 16 17:13:32 UTC 2000


Stefan Matthias Aust <sma at 3plus4.de> wrote:

> - No support for different alignment per paragraph (You could simulate this
> by adding more than one text editor in an alignment morph but that's a pain
> in the neck IMHO)
> 


Incidentally, this fairly easy to implement in Squeak.  I've done it and
lost it a couple of times while working on an enriched-text formatter
that I never released.  You might even notice that there is an
"alignment" variable in class CharacterScanner.  This slipped in there
because I was working in the same image on a mod that *did* get
included.


So for anyone interested, here's how it can be done:

	- add a new TextAttribute for alignment

	- have the emphasizeScanner: code for this attribute modify the
alignment that the scanner is using

	- modify alt-u so that it only modifies the currently highlighted
region, instead of modifying everything

	- to finish up, fiddle with making alignments combine with each other
properly, so that you don't get nested alignment attributes which just
override each other.


The TextAttribute and CharacterScannor system is really pretty flexible.
 Anyone with ideas about text-editting in Squeak should dive in and play
with it.


Lex





More information about the Squeak-dev mailing list