Carbon


TXNEchoMode

Header: MacTextEditor.h Carbon status: Supported

Determines whether a specified character is drawn instead of the glyph associated with the input character.

OSStatus TXNEchoMode (
    TXNObject iTXNObject, 
    UniChar echoCharacter, 
    TextEncoding encoding, 
    Boolean on
);
Parameter descriptions
iTXNObject

A variable of type TXNObject. Pass the text object for the current text area.

echoCharacter

A variable of type UniChar. Pass a value specifying the substitute character.

encoding

A variable of type TextEncoding. Pass a value specifying the text encoding from which the substitute character is drawn.

on

A variable of type Boolean. Pass true to turn on character substitution. Pass false to turn it off.

function result

A result code. .

DISCUSSION

When character substitution is on for a text object (that is, when it is in “echo mode”) all characters in the text area have the character specified in iEchoCharacter substituted for the actual glyph when drawing occurs.

You can use TXNEchoMode when you want to hide what the user inputs, such as a password in a login dialog box.

Note that the substitution character is a UniChar data type, but this is done merely to facilitate passing any 2-byte character. The encoding parameter actually determines the encoding used to locate a font and display a character. Thus if you wanted to display the diamond found in the Shift-JIS encoding for Mac OS, you would pass in 0x86A6 for the character, but pas in an encoding that was built to represent the Mac OS Japanese encoding.

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)