Carbon


TXNDragReceiver

Header: MacTextEditor.h Carbon status: Supported

Handles receiving dragged data in a text object for which a custom drag handler is already in place.

OSErr TXNDragReceiver (
    TXNObject iTXNObject, 
    TXNFrameID iTXNFrameID, 
    WindowRef iWindow, 
    DragReference iDragReference, 
    Boolean iDifferentObjectSameWindow
);
Parameter descriptions
iTXNObject

A variable of type TXNObject. Pass the text object that is receiving the dragged data.

iTXNFrameID

A variable of type TXNFrameID. Pass a frame ID identifying the frame of the text object that is receiving the dragged data. You obtain a TXNFrameID fromTXNNewObject.

iWindow

A pointer to the window containing the text object that is receiving a drag. The Drag Manager provides this window pointer to your drag handler.

iDragReference

A variable of type DragReference. Pass a reference to the dragged data that you want MLTE to handle. The Drag Manager provides this reference to your drag handler.

iDifferentObjectSameWindow

A variable of type Boolean. Pass true if the drag operation is in the same window that it started in, but in a different text object within that window. If there is only one text object in a window, you should always pass false. You should also pass false if the drag operation has moved into a different window than the one in which it originated. You can determine whether the drag operation has left the originating window by calling the Drag Manager function GetDragAttributes.

function result

A result code. A Drag Manager result code.

DISCUSSION

You would not typically use the TXNDragReceiver function, because MLTE provides basic drag management or you.

However, you might call TXNDragReceiver if your application needs to examine the dragged data prior to MLTE handling it, or if you have multiple text objects in a window, or if you have your own drag management infrastructure that you want to use.

You must inform MLTE that you wish to handle some aspect of the drag process by passing the TXNFrameOptions value kTXNDoNotInstallDragProcsMask in the iFrameOptions parameter of TXNNewObject. If you do so, you are responsible for calling the drag handlers for the drag operation. Then, you should call TXNDragReceiver when your drag receiver is called and you want MLTE to take over control of the drag reception process.

When you call TXNDragReceiver, MLTE takes over the drag operation and handles everything from that point onward. This includes determining whether the text object is a valid drop target and if the dragged data is an MLTE-supported type, as well as managing the addition of the dragged data to the text object.

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)