Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[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?




On samedi, novembre 10, 2007, at 02:02 PM, John C. Randolph wrote:

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.

That's somehow what I fear from a user experience point of view.

Since there does not seem to be a method or constant to define the threshold, we end up with having different thresholds; not only within Cocoa apps but also between Cocoa and Carbon apps.

I guess the idea is to file an enhancement request so that we can eventually get a constant in 2010.


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: NSView / Drag and Drop: Any API or constants to detect the start of a drag? (From: "John C. Randolph" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.