Re: Drag pasteboard only working within my app?
Re: Drag pasteboard only working within my app?
- Subject: Re: Drag pasteboard only working within my app?
- From: Matt Neuburg <email@hidden>
- Date: Tue, 3 Sep 2002 23:33:35 -0700
>
Date: Wed, 4 Sep 2002 00:10:52 -0400
>
Subject: Drag pasteboard only working within my app?
>
From: Jorge Monteiro <email@hidden>
>
>
I compiled my app with Jaguar (10.2) / Developer Tools (July + August
>
update) and now it does not work :( The problem is with dragging. The
>
code that used to work now only works within my app, trying to drag to
>
any other app (including another instance of my app) does not work.
>
>
Anyone has a clue why a dragging pasteboard is not being accepted
>
anywhere but within the app that started the drag? This happens both
>
from:
>
>
- (BOOL)tableView:(NSTableView *)tv
>
writeRows:(NSArray*)rows
>
toPasteboard:(NSPasteboard*)pboard
>
>
and from
>
>
- (BOOL)outlineView:(NSOutlineView *)outlineView
>
writeItems:(NSArray*)items
>
toPasteboard:(NSPasteboard*)pboard
The question of whether a drop is accepted in another app has nothing to do
with tableView:writeRows:toPasteboard and so forth. All that does is allow
the drag to begin. When the drop reaches the other app, it must exhibit an
interest in at least one of the types on the pasteboard and ask for it.
When it does, you are called again with
draggingSourceOperationMaskForLocal:. *That* is where the decision is made
whether to allow a drop outside the app, based on the value of the boolean
parameter isLocal. I suggest you override this method in your NSTableView
subclass (and your NSOutlineView subclass) so that you can return the
permissible drag operations you desire. m.
--
matt neuburg, phd = email@hidden,
http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart.
http://www.tidbits.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.