Re: NSFilePromisePboardType
Re: NSFilePromisePboardType
- Subject: Re: NSFilePromisePboardType
- From: The Karl Adam <email@hidden>
- Date: Fri, 17 Dec 2004 10:51:58 -0500
I didn't miss the point, that removes context sensitive information.
What if your OutlineView has several differnt objects in it that need
different accompanying data or come from different data sources. You
can't just add in that extra info since your no longer in the data
source from which that data came. For example, URLs when you drag them
there are 12 different pboard types on the pasteboard and each has a
different use, ONE of the is a file promise for when you put them down
and it creates a file shortcut. So when you get a FilePromisePboard
with .htm how exactly do you plan on figuring out which website that
came from? How about interapplication data? What if I wanted to add
teh original item ontu my pasteboard? How do I know which of the many
.foo items in my outline view corresponds to the item on the
pasteboard?
Perhaps it's you who didn't think before he responded, I read the
manual and everything about File Promises in order to manually make
them work for me.
Your way isn't more official unless you write a custom view that only
sends out file promises or for which your outline view has very few
items such that you can easily discern which original item the
filetype came from, or all your items need the same context info added
to them. Since the entire point was most of us need the rest of that
info when we originally had access to the datasource. Add to that the
fact you need to cancel the initial drag that started in the first
place.
So again, I ask you, what about this method is more better? It's less
flexible and requires that I dimiss an in progress drag to start
another more limited one.
-Karl
On Fri, 17 Dec 2004 10:23:47 +0100, Peter Maurer <email@hidden> wrote:
> >> Why don't you simply use [NSOutlineView dragPromisedFilesOfTypes: ...]
> >
> > What event are you sending with that?
>
> I'm sending [NSApp currentEvent]. But you could also explicitly store
> the latest mouseDown event in your table-/outlineView subclass and use
> that.
>
> > Plus the docs read that it needs
> > to be invoked from the mouseDown: method since that has an event to
> > attach it to.
>
> Well, you can invoke it from your table-/outlineView's
> -writeItems:toPasteboard: method (cf.
> <http://cocoa.mamasam.com/COCOADEV/2003/03/2/59748.php>). Or you can
> take over your outline view's mouseDown/mouseDragged mechanism
> completely.
>
> > Even if that wasn't the case, the entire point is that
> > you can't put extra data on the pboard with that method. with mine all
> > the data you want arrives intact then you attach the file promise
> > stuff. Though I don't use any extra types you can easily enough
> > change the code to support them.
>
> You seem to have missed the following statement from my previous
> e-mail...
>
> >> (...) and override your outline view's
> >> -dragImage:at:offset:event:pasteboard:source:slideBack: method to add
> >> any additional pasteboard type you might want to use?
>
> Just send [pasteboard addTypes:owner:] from within your subclass's
> [self dragImage:at:offset:event:pasteboard:source:slideBack:] to add
> any additional types of pasteboard.
>
> <http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/
> Tasks/faq.html#//apple_ref/doc/uid/20002248/BBCFIJGF>
>
> Sometimes reading the manual is indeed worth while... ;-D
>
> Peter.
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden