Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: promising files in drags



Drag file "promises" (an unfortunately overridden word) are still a little overly complex. I have ideas to address this in a future release but some of the issues involved are... subtle. =) Here's a link to documentation that should help you with understanding the current model.

http://developer.apple.com/technotes/tn/tn1085.html


On Jul 29, 2005, at 9:27 AM, Steve Mills wrote:

I'm very confused about drag promises and such. Another company wants to send our app promised drags - the files are not actually available until after our app says we'll accept the drag and the mouse is released.

If their app adds kDragFlavorTypePromiseHFS, then our app gets that and inspects the PromiseHFSFlavor struct that's in that drag item, and we can accept the file based on that struct, we return noErr to the kDragTrackingInWindow message.

Now what happens? Their app needs to add kDragFlavorTypeHFS, otherwise our app will never get a file reference, right? Or is something else supposed to happen?

You need to set the DropLocation so the sending application knows where to place the newly minted file. Then you can call in their promise to kDragFlavorTypeHFS to the the real file data.



Another part of the confusion is "promising" a drag flavor by adding it with nil data. Which way is better, adding kDragFlavorTypeHFS with nil data and setting the flavorDataPromised flag, or to use kDragFlavorTypePromiseHFS with the PromiseHFSFlavor struct?

The flavorDataPromised flag is set automatically by the system when a flavor is promised with NULL data. Requesting both flavor types are in the proper order is required for the full "promised file" handshake to be complete. This is why things are a little complex. Take a look at the documentation I provided above for more details.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden


This email sent to email@hidden
References: 
 >promising files in drags (From: "Steve Mills" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.