• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get registered dragged types from NSWindow?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to get registered dragged types from NSWindow?
      • From: Keary Suska <email@hidden>
References: 
 >How to get registered dragged types from NSWindow? (From: Oleg Krupnov <email@hidden>)

  • Prev by Date: How to get registered dragged types from NSWindow?
  • Next by Date: Re: Cococa-Dev : was [coredata count not fulfill fault after object delete]
  • Previous by thread: How to get registered dragged types from NSWindow?
  • Next by thread: Re: How to get registered dragged types from NSWindow?
  • Index(es):
    • Date
    • Thread