Re: Drag and drop from NSCollectionView (bug?)
Re: Drag and drop from NSCollectionView (bug?)
- Subject: Re: Drag and drop from NSCollectionView (bug?)
- From: Graham Cox <email@hidden>
- Date: Thu, 2 Oct 2008 16:26:30 +1000
On 2 Oct 2008, at 4:02 pm, Matteo Manferdini wrote:
I subclassed them both and implemented mouseDragged: method, but if
i put a breakpoint inside of both of them, I see it never gets
called when I drag the mouse. Other methods (like mouseDown:) work
well, so I wonder why this method isn't working.
Has anyone been able to make this work? Any clue? May be this a bug?
It's probably because NSCollectionView implements its own mouse
tracking loop, which is all handled in mouseDown: It then flushes
events when it finishes so that the view's -mouseDragged: and -
mouseUp: methods are not called. This isn't all that unusual.
If you override -mouseDown: to NOT call super, you should find that -
mouseDragged: gets called. If it does, this confirms the presence of
an internal tracking loop.
It should be possible to graft on NSDraggingSource features using this
information, though discriminating between the users intentions -
dragging an item off versus dragging out a number of selected items in
the view - might be tricky.
hth, Graham
_______________________________________________
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