FROM : Daniel Morrow
DATE : Wed Oct 13 17:19:34 2004
On Oct 13, 2004, at 10:39 AM, Avi Drissman wrote:
> On Oct 13, 2004, at 10:22 AM, Daniel Morrow wrote:
>
>> I ask it how many items are in the dragref. It tells me 1, so far, so
>> good. Next I get the DragItemRef, and it oddly always has the address
>> "0x000C0C0A". Which is amusing. But I really need to get the data out
>> of it.
>
> So just use the usual GetFlavorFlags, GetFlavorData, and the like.
> Just because the DragItemRef is a funny number doesn't mean that it's
> invalid.
>
> Avi (who's written an InDesign plugin that does drag receives)
>
Ok, well that's fine, except when I call "CountDragItemFlavors" I get
returned 0.
Now, in Cocoa, AFAIK, there is no way to add a "flavor" with a 4-char
code to a drag.
Basically, my cocoa code looks like this:
[pboard declareTypes:[NSArray arrayWithObject:@"IsGm"] owner:nil];
BOOL result = [pboard setString:@"10111" forType:@"IsGm"];
I'm trying to pass custom data, so I'm declaring a data type "IsGm".
Then I'm adding a string, "10111" to it. This string will change to a
different block of data in the future, which is why I'm not using a
predefined type like "NSStringPboardType", because I don't want to
watch for all text being dropped on my app, I just want to watch for my
special block of data, being dropped on the app.
Anyway, when I do this, CountDragItemFlavors is always 0. I'd think it
should be 1, but this is not the case.
Thanks for any help in this matter,
-Dan.
DATE : Wed Oct 13 17:19:34 2004
On Oct 13, 2004, at 10:39 AM, Avi Drissman wrote:
> On Oct 13, 2004, at 10:22 AM, Daniel Morrow wrote:
>
>> I ask it how many items are in the dragref. It tells me 1, so far, so
>> good. Next I get the DragItemRef, and it oddly always has the address
>> "0x000C0C0A". Which is amusing. But I really need to get the data out
>> of it.
>
> So just use the usual GetFlavorFlags, GetFlavorData, and the like.
> Just because the DragItemRef is a funny number doesn't mean that it's
> invalid.
>
> Avi (who's written an InDesign plugin that does drag receives)
>
Ok, well that's fine, except when I call "CountDragItemFlavors" I get
returned 0.
Now, in Cocoa, AFAIK, there is no way to add a "flavor" with a 4-char
code to a drag.
Basically, my cocoa code looks like this:
[pboard declareTypes:[NSArray arrayWithObject:@"IsGm"] owner:nil];
BOOL result = [pboard setString:@"10111" forType:@"IsGm"];
I'm trying to pass custom data, so I'm declaring a data type "IsGm".
Then I'm adding a string, "10111" to it. This string will change to a
different block of data in the future, which is why I'm not using a
predefined type like "NSStringPboardType", because I don't want to
watch for all text being dropped on my app, I just want to watch for my
special block of data, being dropped on the app.
Anyway, when I do this, CountDragItemFlavors is always 0. I'd think it
should be 1, but this is not the case.
Thanks for any help in this matter,
-Dan.
| Related mails | Author | Date |
|---|---|---|
| Daniel Morrow | Oct 13, 16:22 | |
| Daniel Morrow | Oct 13, 17:19 | |
| Daniel Morrow | Oct 13, 21:43 | |
| Daniel Morrow | Oct 13, 21:46 |






Cocoa mail archive

