Re: drag and drop images to NSWindow doesn't work
Re: drag and drop images to NSWindow doesn't work
- Subject: Re: drag and drop images to NSWindow doesn't work
- From: "Bill So" <email@hidden>
- Date: Thu, 27 Sep 2007 12:22:49 +0800
Yeah, I m dragging a file from Finder to my app. (though the file is an image)
I'll change my code to recognize that then.
Thanks,
Bill
On 9/25/07, Charles Steinman <email@hidden> wrote:
>
> --- Bill So <email@hidden> wrote:
>
> > Dear all,
> >
> > I m trying the drag n drop behavior of NSWindow
> > using the following excerpt:
> >
> > - (void)awakeFromNib {
> >
> > NSArray *myAy = [NSImage imagePasteboardTypes];
> >
> > [window registerForDraggedTypes:myAy];
> >
> > //[window registerForDraggedTypes:[NSArray
> > arrayWithObjects:NSFilenamesPboardType,
> > NSURLPboardType, nil]];
> > }
> > [SNIP]
> > However, if I use the image pasteboard types, the
> > sample app doesn't
> > respond to any image dragging into the window.
> >
> > If I use the commented code in "awakeFromNib"
> > instead, it prints those
> > debug message.
>
> It sounds like you're dragging an image file, which is
> a file rather than an image, so you need that
> pasteboard type to recognize the drag.
>
> Cheers,
> Chuck
>
>
>
> ____________________________________________________________________________________
> Yahoo! oneSearch: Finally, mobile search
> that gives answers, not web links.
> http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
>
_______________________________________________
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