Hey Jonathan & Thomas,

it's finally working and even more easier than I've thought: So I made a subclass of my IKImageBrowserView and added a new delegate method, the one's missing:

// -------------------------------------------------------------------------------
// -browserView:droppedIndexes:atDestination:
// ------------------------------------------------------------------------------- - (void)browserView:(ESPImageBrowserView *)bv droppedIndexes: (NSIndexSet *)indexSet atDestination:(NSURL *)dropDestination
{
        if (self.delegate)
        {
if ([self.delegate respondsToSelector :@selector(browserView:droppedIndexes:atDestination:)])
                {
[self.delegate browserView:bv droppedIndexes:indexSet atDestination:dropDestination];
                }
        }
}

it's called from:

// -------------------------------------------------------------------------------
// -namesOfPromisedFilesDroppedAtDestination:
// ------------------------------------------------------------------------------- - (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
{
[self browserView:self droppedIndexes:[self selectionIndexes] atDestination:dropDestination];
        return nil;
}

No need to implement :mouseDown- or -mouseDragged: :-)

Thank you for your help!

Best regards,
Tobias Jordan.

On Oct 25, 2009, at 12:41 PM, jonat...@mugginsoft.com wrote:

That might prove to be the case.
Others think the same: 
http://www.cocoabuilder.com/archive/message/cocoa/2009/7/29/241852

An approach might be to use an NSTableView instance as a drag source proxy. When your IKImageBrowserView instance gets a drag request pass it on to the tableview which can deliver on the promise.
You would have to keep the datasources synchronised of course.
Either that or populate the tableview with just the items to be dragged when the IKImageBrowserView
drag begins.

Just an idea. Might be tricky to pull off in practice.

Regards

Jonathan Mitchell

Developer
http://www.mugginsoft.com



On Oct 25, 2009, at 3:41 PM, Thomas Goossens wrote:

Ok, I didn't catch you need to create special folder structures.
So you can only do that with promised files and since there is no equivalent to "tableView:namesOfPromisedFilesDroppedAtDestination" in the IKImageBrowseView, you will have to do everything at the NSView level using "dragPromisedFilesOfTypes:fromRect:source:slideBack:event:" and "namesOfPromisedFilesDroppedAtDestination:". But that means you will have to detect when the drag should start (with mouseDown/mouseDragged + IK's indexOfItemAtPoint) and setup your drag image yourself.

-- Thomas

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to