Carbon


TXNSetData

Header: MacTextEditor.h Carbon status: Supported

Replaces a range of data (text, graphics, and so forth) with the data you specify.

OSStatus TXNSetData (
    TXNObject iTXNObject, 
    TXNDataType iDataType, 
    void *iDataPtr, 
    ByteCount iDataSize, 
    TXNOffset iStartOffset, 
    TXNOffset iEndOffset
);
Parameter descriptions
iTXNObject

A variable of type TXNObject. Pass the text object that identifies the document in which you want to replace data.

iDataType

A variable of type TXNDataType that specifies the type of the replacement data.

iDataPtr

A pointer to the data that will replace what’s in the range specified by iStartOffset and iEndOffset.

iDataSize

A variable of type ByteCount that specifies the size of the data to which iDataPtr points.

iStartOffset

A variable of type TXNOffset that specifies the beginning of the range of data to replace. You can use the TXNGetSelection function to get the absolute offsets of the current selection.

iEndOffset

A variable of type TXNOffset. You use this to specify the end of the range to replace. You can use the TXNGetSelection function to get the absolute offsets of the current selection. If you want to insert text, the ending and starting offsets should be the same value.

function result

A result code. TXNSetData can also return parameter and memory errors.

AVAILABILITY

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


© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)