Carbon


TEStyleNew

Header: TextEdit.h Carbon status: Not Recommended

Creates a multistyled edit structure and allocates a handle to it.

TEHandle TEStyleNew (
    const Rect *destRect, 
    const Rect *viewRect
);
Parameter descriptions
destRect

A pointer to the destination rectangle for the new edit structure, specified in the local coordinates of the current graphics port. This is the area in which text is laid out.

viewRect

A pointer to the view rectangle for the new edit structure, specified in the local coordinates of the current graphics port. This is the area of the window in which text is actually displayed.

function result

A handle to the newly created edit structure. Your application needs to store the handle to the edit structure that is returned; many functions require it as an input parameter.

DISCUSSION

A multistyled edit structure contains text whose attributes, including font, size, and style, can vary from character to character. Always use the TEStyleNew function to create an edit structure for text that uses varying character attributes. The TEStyleNew function sets the txSize, lineHeight, and fontAscent fields of the edit structure to –1, allocates a style structure, and stores a handle to the style structure in the txFont and txFace fields. The TEStyleNew function creates and initializes a null scrap that is used by TextEdit functions throughout the life of the edit structure.

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

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

Before this function is called, the window must be in the current graphics port.

AVAILABILITY

Not recommended in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)