Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Q&As > Legacy Documents > Mac OS 9 & Earlier >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Dragging to the Trash

Q How do I support dragging to the trash and avoid having the Finder create a clipping inside the trash? I tried several options but they all failed.

A There is no good way to prevent both a clipping file and the failed-drag zoom feedback. The problem is that Finder treats the trash like a folder for this purpose. In this context, the drag succeeds or fails according to the user's supposed intent with respect to a folder.

However, in our opinion, this is good, since it is consistent with the Trash metaphor. When the user drags an icon from a Finder window into the trash, they expect the trash to get fat so the user can later change their mind, open the Trash and drag the icon out. Creating a clipping file in the trash merely extends the metaphor. The only problem this might cause is that the user ought to be able to reverse their decision and drag the clipping back into the application. If your application doesn't already support this action, you may have some work ahead.

We realize other apps manage to avoid making the Trash fat. This is, in our opinion, a Bad Thing. A hack. Wrong. Nevertheless, if you still feel you need to avoid making the trash fat, it might be possible to do so. It would probably involve creating a file via flavorTypePromiseHFS, then deleting it before Finder had a chance to make the Trash fat. Unfortunately, since this involves "fooling" Finder, it isn't likely to work for future versions of Finder even if it does work today.

[Nov 27 1996]