Up   Previous   Next  

Handling a Mouse Event

You can use the MLTE function TXNClick to process mouse events in a window's content region. This function takes care of scrolling, text selection, playing sound and movies, handling drag-and-drop operations, and responding to double-click events.

Listing 3-10 shows a MyDoClickInWindowContentRgn function that handles a mouse event that occurs in the content area of a text object attached to a window.

Listing 3-10 Handling a mouse event
void MyDoClickInWindowContentRgn (WindowPtr theWindow, EventRecord *event) { TXNObject textObject; // Call your own function to get text object. MyGetTextObject (theWindow, &textObject); // Call the MLTE function to process the event. TXNClick (textObject, event); }

Copyright © 2001 Apple Computer, Inc. (Last Updated January 11, 2001)

Up   Previous   Next