• 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: Handle drop to WebView: WebDragDestinationActionDHTML
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handle drop to WebView: WebDragDestinationActionDHTML


  • Subject: Re: Handle drop to WebView: WebDragDestinationActionDHTML
  • From: Mike Abdullah <email@hidden>
  • Date: Thu, 28 Oct 2010 01:08:45 +0100

Subclass WebView and override the standard NSDraggingDestination methods.

On 28 Oct 2010, at 00:19, Wayne Shao wrote:

> I would like to handle drop to WebView to not load the  dropped object, but
> to perform some customized action.
> However, I ran into similar issues as described here:
>
> http://lists.apple.com/archives/webkitsdk-dev/2005/May/msg00046.html
>
> Basically, for these two callbacks in WebUIDelegate,
>
>   - A. – webView:dragDestinationActionMaskForDraggingInfo:<http://developer.apple.com/library/mac/documentation/Cocoa/Reference/WebKit/Protocols/WebUIDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/instm/NSObject/webView:dragDestinationActionMaskForDraggingInfo:>
>   -
>   - B. – webView:willPerformDragDestinationAction:forDraggingInfo:<http://developer.apple.com/library/mac/documentation/Cocoa/Reference/WebKit/Protocols/WebUIDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/instm/NSObject/webView:willPerformDragDestinationAction:forDraggingInfo:>
>   -
>
> My question is: How can I return something other
> than WebDragDestinationActionLoad in A and still have a chance to process
> the data in method B?
>
> Currently, the issues are:
>
>
>   - If I return WebDragDestinationActionDHTML, B is never called.
>   - If  return WebDragDestinationActionLoad, B is called, but I do not want
>   to load the dropped resource. I want to customize it by extracting data and
>   update the current resource in WebView.
>   - Another option is to do the custom data extraction in A and
>    return WebDragDestinationActionNone. But the callback A is invoked multiple
>   times during a drag/drop operation, I need to only process it once at the
>   last callback.  i.e., the correct place to do it is in callback method B.
>
> Any solutions?
>
> Thanks,
> --
> W. Shao
> _______________________________________________
>
> 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

References: 
 >Handle drop to WebView: WebDragDestinationActionDHTML (From: Wayne Shao <email@hidden>)

  • Prev by Date: Re: Drag and drop between two table views.
  • Next by Date: NSMomentaryLightButton vs. NSMomentaryPushInButton and NSPushOnPushOffButton vs. NSOnOffButton
  • Previous by thread: Handle drop to WebView: WebDragDestinationActionDHTML
  • Next by thread: NSMomentaryLightButton vs. NSMomentaryPushInButton and NSPushOnPushOffButton vs. NSOnOffButton
  • Index(es):
    • Date
    • Thread