Carbon


TXNSetSelection

Header: MacTextEditor.h Carbon status: Supported

Specifies the selection range or the position of the insertion point.

OSStatus TXNSetSelection (
    TXNObject iTXNObject, 
    TXNOffset iStartOffset, 
    TXNOffset iEndOffset
);
Parameter descriptions
iTXNObject

A variable of type TXNObject. Pass the text object that identifies the document for which you want to set the selection range or insertion point position.

iStartOffset

A variable of type TXNOffset. You use this to specify the new start offset. Offset values are character offsets.

iEndOffset

A variable of type TXNOffset. You use this to specify the new end offset. Offset values are character offsets.

function result

A result code.

DISCUSSION

You can use the TXNSetSelection function to highlight an initial default value in a document, such as a data-entry form, or to position the insertion point at the start of the field where you want the user to enter a value. To position the insertion point, specify the same value for the iStartOffset and iEndOffset parameters.

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)