Re: NSDragOperationDelete
Re: NSDragOperationDelete
- Subject: Re: NSDragOperationDelete
- From: Steve Gehrman <email@hidden>
- Date: Mon, 7 Oct 2002 15:17:35 -0700
Well, I thought of a clever solution...
I rewrote my trash can view to use Carbon drag manager calls. This
works great, the Finder now works, but now Cocoa apps expecting
NSDragOperationDelete don't work. I get a NSDragOperationGeneric in
draggedImage. So no matter which way you go, your screwed.
Apple! What is your problem? I spend 80% of my time working around
bugs/limitations in OS X and 20% writing real code. Cocoa isn't like
"...starting on the 27th floor" (Jobs Quote) I feel like I'm starting
in the basement... :)
Anyone from the Finder team out there who knows how to get this working?
On Monday, October 7, 2002, at 12:39 PM, Brian Webster wrote:
>
I don't think the dock can really be considered either a Carbon or a
>
Cocoa app, since it is pretty specialized, although it doesn't appear
>
to use Cocoa at all (class-dump reveals it has no Objective-C
>
classes), so I guess one would call it a Carbon app. There is
>
actually a (private) common layer that sits underneath both the Carbon
>
and Cocoa dragging mechanisms, and I'm pretty sure that the Dock just
>
uses that. The problem is that there is nothing present in the Cocoa
>
layer that lets you access the trash functionality that exists in the
>
lower layer.
>
>
On Monday, October 7, 2002, at 02:27 PM, Steve Gehrman wrote:
>
>
>
>
> Is the Dock written in Cocoa? If so, it must be doing something to
>
> communicate with the Finder to indicate a delete.
>
>
>
> On Monday, October 7, 2002, at 07:14 AM, Brian Webster wrote:
>
>
>
>> On Monday, October 7, 2002, at 12:00 AM,
>
>> email@hidden wrote:
>
>>
>
>>> The problem is that if I drag a file from the Finder, the Finder
>
>>> does
>
>>> nothing. The Finder should do something similar to my draggedImage
>
>>> call
>
>>> and see that the drag operation is NSDragOperationDelete and move
>
>>> the
>
>>> file to the trash.
>
>>
>
>> I believe this is because the Carbon drag manager uses a somewhat
>
>> different paradigm when it comes to deleting files. There isn't
>
>> really a separate "delete" operation, but it is instead treated as a
>
>> file move, but applications are supposed to check to see if the file
>
>> (or other object) is being moved to the trash, and if it is, act
>
>> appropriately. The trash can in the dock will return the trash
>
>> folder as the drop location and the Finder responds by moving the
>
>> dragged files to the trash. Unfortunately, there doesn't appear to
>
>> be any mechanism in Cocoa to do this.
>
>>
>
>> That being said, I think you should think twice about creating an
>
>> exact duplicate of a standard interface element such as the trash
>
>> can, unless you're making some sort of dock replacement or something
>
>> along those lines.
>
>>
>
>> --
>
>> Brian Webster
>
>> email@hidden
>
>> http://homepage.mac.com/bwebster
>
>>
>
>>
>
> --
>
> Steve Gehrman
>
> email@hidden
>
> http://www.cocoatech.com
>
>
>
>
>
--
>
Brian Webster
>
email@hidden
>
http://homepage.mac.com/bwebster
>
>
--
Steve Gehrman
email@hidden
http://www.cocoatech.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.