Re: -mouseDragged: sent to view when dragging window
Re: -mouseDragged: sent to view when dragging window
- Subject: Re: -mouseDragged: sent to view when dragging window
- From: Markus Spoettl <email@hidden>
- Date: Wed, 25 Jul 2012 09:19:02 +0200
On 7/24/12 11:29 PM, Quincey Morris wrote:
My view reacts to -mouseDragged: but doesn't check if there's been a
-mouseDown: first because that's implicit. Did that change?
The Cocoa Event Handling Guide says "Mouse events are dispatched by
an NSWindow object to the NSView object over which the event occurred", so I
guess there's a lag/race condition that's putting your view under the mouse
pointer at the moment the event is generated.
It also states (a few times in different wording):
For each dragging sequence, the Application Kit sends a mouseDown: message to a
responder object, then sends one or more mouseDragged: messages, and ends the
sequence with a mouseUp: message.
<<<<<
While it doesn't spell it out, it's pretty clear they're talking about the same
view/responder for all those events.
I think it's implicit that a mouseDown has occurred before a mouseDragged, but I
don't see anything that guarantees they're sent to the same view. In that case,
you should really set a state flag in mouseDown that's checked in mouseDragged.
When I click into a view and drag, it gets all dragging events, even if the
cursor is dragged outside its frame. Also, views over which the cursor is
dragged during this process, don't get a single -mouseDragged: message.
I don't believe that getting -mouseDragged: without a prior -mouseDown: or
following -mouseUp: is intentional.
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
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