• 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: NSView / Drag and Drop: Any API or constants to detect the start of a drag?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView / Drag and Drop: Any API or constants to detect the start of a drag?


  • Subject: Re: NSView / Drag and Drop: Any API or constants to detect the start of a drag?
  • From: "John C. Randolph" <email@hidden>
  • Date: Sat, 10 Nov 2007 05:02:19 -0800


On Nov 10, 2007, at 2:48 AM, Stéphane Sudre wrote:

Unfortunately, I had a look at this method during my search.

There's no "magnetism" with this call : you get the message as soon as the mouse moved from 1 pixel.

Stephane,

What we typically do in a Cocoa app for the behavior you describe is to save the location of the mouseDown event, and compare it to the location of a mouseDragged event. If the distance is greater than whatever threshold you want, then you go ahead and send a - dragFile:... or -dragImage:... type of message.

In some cases, drag and drop is chosen by a modifier key, and in those situations, you probably want to go ahead and initiate the dragging session without caring how far the cursor has moved.

-jcr_______________________________________________

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: NSView / Drag and Drop: Any API or constants to detect the start of a drag?
      • From: Stéphane Sudre <email@hidden>
References: 
 >Re: NSView / Drag and Drop: Any API or constants to detect the start of a drag? (From: Stéphane Sudre <email@hidden>)

  • Prev by Date: Re: Notification when switching Spaces?
  • Next by Date: Trouble with NSURLCache
  • Previous by thread: Re: NSView / Drag and Drop: Any API or constants to detect the start of a drag?
  • Next by thread: Re: NSView / Drag and Drop: Any API or constants to detect the start of a drag?
  • Index(es):
    • Date
    • Thread