![]() |
TXNAdjustCursor |
||||
Header: | MacTextEditor.h | Carbon status: | Supported | |
Obtains the current cursor position and draws the cursor in a form appropriate to the content over which it is placed.
void TXNAdjustCursor ( TXNObject iTXNObject, RgnHandle ioCursorRgn );
A variable of type TXNObject. Pass the text object that identifies the text area for which MLTE should adjust the cursor.
A variable of type RgnHandle. Pass NULL if you do not want TXNAdjustCursor to provide information about the cursor position to your application. If you do want to obtain the cursors current position, pass a valid region handle in this parameter. If you pass a valid region handle and the cursor is over the text area or its scroll bars, on return TXNAdjustCursor sets the region to a 2-pixel by 2-pixel square, centered on the cursors hot spot. If the cursor is not over the text area or its scroll bars, or if you have passed NULL, TXNAdjustCursor does not adjust the input value.
If the cursor is over a text area, TXNAdjustCursor sets the cursor to an I-beam. If the cursor is over graphics, a sound file, a movie, a scroll bar, or outside of a window, TXNAdjustCursor sets the cursor to an arrow. Before you call the TXNAdjustCursor function, you should make sure that the window belongs to your application.
You can supply the cursor position value returned the ioCursorRgn parameter to the WaitNextEvent function; this ensures that you receive mouse-moved events if the cursor moves outside that region. If you then receive a mouse-moved event, you can call TXNAdjustCursor again to ensure that the cursor type is appropriate to its new position. Alternately, to ensure that the cursor is adjusted correctly, you can simply call TXNAdjustCursor with every event that your application receives.
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)