Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 2 - TextEdit / TextEdit Reference
Routines / Displaying and Scrolling Text


TESetAlignment

The TESetAlignment procedure sets the alignment of the specified text in an edit record so that it is centered, right aligned, or left aligned, or aligned according to the
line direction.

PROCEDURE TESetAlignment (align: Integer; hTE: TEHandle); 
align
The alignment for the specified text.
hTE
A handle to the edit record containing the text.
DESCRIPTION
You can use the following constants to specify the text alignment through the
align parameter.
ConstantValueDescription
teFlushDefault 0Align according to primary line direction
teCenter 1Centered for all scripts
teFlushRight-1Right aligned for all scripts
teFlushLeft-2Left aligned for all scripts

For compatibility, the previous names of these constants are still supported. They are teJustLeft, teJustCenter, teJustRight, and teForceLeft.

The default value of the just field of the edit record is teFlushDefault. This means that text alignment is based on the primary line direction which is set by default according to the system script.

For languages that are read from right to left, text is right aligned by default. For languages that are read from left to right, text is left aligned by default. If you change the alignment, call the InvalRect procedure after TESetAlignment to redraw the text with the new alignment.

TextEdit does not support justified alignment. To draw justified text, use the QuickDraw Text routines.

SEE ALSO
For more information about the InvalRect procedure, see the chapter "Window Manager" in Inside Macintosh: Macintosh Toolbox Essentials. For more information about drawing justified text, see the chapter "QuickDraw Text" in this book.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996