Carbon


TXNActivate

Header: MacTextEditor.h Carbon status: Supported

Makes the text display area (that is, frame) of a text object active.

OSStatus TXNActivate (
    TXNObject iTXNObject, 
    TXNFrameID iTXNFrameID, 
    TXNScrollBarState iActiveState
);
Parameter descriptions
iTXNObject

A variable of type TXNObject. Pass the text object that identifies the document to be activated.

iTXNFrameID

A variable of type TXNFrameID. Pass the TXNFrameID value that identifies the frame of the document that is to be activated. You obtain a frame ID from TXNNewObject.

iActiveState

A “Scroll Bar States” value. If you pass true, the scroll bars are always active, whether or not the frame’s text area currently has keyboard focus. Passing true can be useful for a window such as a dialog box that may contain multiple text areas, each of which may have a scrollable frame. If you pass false, MLTE synchronizes the activity state of the scroll bars with the focus state of the frame. Therefore, only when the frame has keyboard focus does it have active scroll bars. A value of false is the default and is typically recommended if you have only one frame per window.

function result

A result code. TXNActivate returns ParamErr if you pass an invalid text object or frame ID.

DISCUSSION

You typically call TXNActivate in response to an activate event. If the text object was previously inactive, TXNActivate removes any visual indication (such as a dimmed or framed selection area or inactive scroll bars) of its prior inactive state. Before you call the TXNActivate function, you should make sure that the window belongs to your application.

The TXNActivate function does not itself change the keyboard focus. To change the keyboard focus, you must use the function TXNFocus. Therefore, if you want to display a text area that has both keyboard focus and active scroll bars, you must call the TXNFocus function immediately after calling the TXNActivate function. Finally, note that MLTE does not retain information about keyboard focus. So if, for example, you have set the keyboard focus on a text area and the window containing the text area gets deactivated, when the window is reactivated you must again call the TXNFocus function.

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)