Re: How to get registered dragged types from NSWindow?
Re: How to get registered dragged types from NSWindow?
- Subject: Re: How to get registered dragged types from NSWindow?
- From: "email@hidden" <email@hidden>
- Date: Mon, 14 Jan 2013 12:02:54 +0000
On 14 Jan 2013, at 11:17, Oleg Krupnov <email@hidden> wrote:
> Unlike NSView, there is no -registeredDraggedTypes method in NSWindow.
> How do I find out which dragged types a window is registered to?
>
Your window has to know what drag types it will respond to.
NSDraggingDestination defines the methods that will be received by the window during the drag.
Query the NSDraggingInfo -draggingPasteboard to see what types are available.
/*
- prepareForDragOperation
*/
- (BOOL)prepareForDragOperation:(id < NSDraggingInfo >)sender
{
BOOL accept = NO;
NSPasteboard *pboard = [sender draggingPasteboard];
// parameter view type
if ( [[pboard types] containsObject:MyPBoardDragType] ) {
accept = YES;
}
return accept;
}
Regards
Jonathan Mitchell
Mugginsoft LLP
_______________________________________________
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