Re: IKImageBrowserView and mouseDragged event
Re: IKImageBrowserView and mouseDragged event
- Subject: Re: IKImageBrowserView and mouseDragged event
- From: Thomas Goossens <email@hidden>
- Date: Fri, 28 Nov 2008 18:10:32 +0100
Sandeep,
If your datasource returns paths, your view should be automatically a
drag source.
If your datasource returns images, I think the only thing you have to
do is to implement
- (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser
writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard:
(NSPasteboard *)pasteboard;
in your datasource and fill the pasteboard with the info you want for
the specified indexes.
more info here:
http://developer.apple.com/documentation/GraphicsImaging/Reference/IKImageBrowserDataSource_Protocol/IKImageBrowserDataSource_Reference.html#//apple_ref/occ/instm/NSObject/imageBrowser:writeItemsAtIndexes:toPasteboard:
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/ImageKitProgrammingGuide/ImageBrowser/chapter_4_section_6.html
-- Thomas.
On Nov 28, 2008, at 11:57 AM, Sandeep Chayapathi wrote:
I did try the -setDraggingDestinationDelegate: , but it is meant
for a drag
destination and not drag source. From the documentation (here:
http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/Concepts/dragsource.html#//apple_ref/doc/uid/20000976-CJBFBADF
)
I have to implement draggingSourceOperationMaskForLocal and invoke
dragImage:at:offset:event:pasteboard:source:slideBack: in
mouseDown: or
mouseDragged: method to make it a drag source. I have a NSView
subclass,
that is a delegate of the IKImageBrowserView view and have
implemented the
methods above, yet these never get called.
Also I tried setting the class of the IKImageBrowserView object to
my custom
class, only then would the - mouseDragged: even would work, but I
lost a
bunch of other IKImageBrowserView features (such as cell selection
etc).
-- Sandeep
On Fri, Nov 28, 2008 at 11:27 AM, douglas welton <
email@hidden> wrote:
Sandeep,
Did you set the dragging destination delegate using
-setDraggingDestinationDelegate:?
more info here:
<
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/ImageKitProgrammingGuide/ImageBrowser/chapter_4_section_7.html#//apple_ref/doc/uid/TP40004907-CH5-SW8
regards,
douglas
On Nov 28, 2008, at 1:12 AM, Sandeep Chayapathi wrote:
Greetings,
In my app I have an IKImageBrowserView, and I want to make this an
drag
source. I have followed thedragging source
docs<
http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/Concepts/dragsource.html#//apple_ref/doc/uid/20000976
but
to no avail. In my view class the mouseDragged never gets called.
Any help
on making the IKImageBrowserView a drag source or making it
respond to
mouseDragged even is appreciated. Thanks.
-- Sandeep
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden