On 14 Jan 2013, at 11:17, Oleg Krupnov <oleg.krup...@gmail.com> 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 (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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to