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 / Initializing TextEdit, Creating an Edit Record, and Disposing of an Edit Record


TEStyleNew

The TEStyleNew function creates a multistyled edit record and allocates a handle to it.

FUNCTION TEStyleNew (destRect: Rect; viewRect: Rect): TEHandle;
destRect
The destination rectangle for the new edit record, specified in the local coordinates of the current graphics port. This is the area in which text is laid out.
viewRect
The view rectangle for the new edit record, specified in the local coordinates of the current graphics port. This is the area of the window in which text is actually displayed.
DESCRIPTION
Always use the TEStyleNew function to create an edit record for text that uses varying character attributes. The TEStyleNew function sets the txSize, lineHeight, and fontAscent fields of the edit record to -1, allocates a style record, and stores a handle to the style record in the txFont and txFace fields. The TEStyleNew function creates and initializes a null scrap that is used by TextEdit routines throughout the life of the edit record.

Call TEStyleNew once for every edit record you want allocated. Your application needs to store the handle to the edit record that is returned; many routines require it as an input parameter.

If your application contains more than one window where text editing occurs, you need to create an edit record for each window.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996