Carbon


TENew

Header: TextEdit.h Carbon status: Not Recommended

Creates and initializes a monostyled edit structure and allocates a handle to it.

TEHandle TENew (
    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, or visible, 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 monostyled edit structure is one in which all text is restricted to a single font, size, and style. Use the TENew function when the text is to be rendered in attributes that are consistent from character to character. Otherwise, use the TEStyleNew function.

Call TENew once for every edit structure you want allocated. Your application should store the handle to the edit structure that is returned; many functions require it as an input parameter. The edit structure assumes the drawing environment of the graphics port.

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)