FROM : Quincey Morris
DATE : Sun Apr 20 18:37:41 2008
On Apr 20, 2008, at 03:43, Ling Wang wrote:
> You can see the code at http://developer.apple.com/samplecode/DragItemAround/listing2.html
> on ADC.
>
> The bug is that the cursor reverts to arrowCursor if the item is
> dragged off the bound calculated at the mouseDown event just before
> current mouseDragged event, instead of staying closedHandCursor.
> Maybe it will be clear till you try to run it.
>
> It seems something happens when the mouse moves out of the cursor
> rect that is set for the item's bounds in resetCursorRects. This
> something is out of my knowledge, so I am hoping someone can tell me
> the cause of the bug and a canonical way to fix it, and I'll
> feedback the solution together with the bug on ADC after that.
Chances are, calling '[[self enclosingScrollView] setDocumentCursor:
[NSCursor closedHandCursor]]' in 'mouseDown:' will fix the problem
you're seeing. NSScrollView/NSClipView's way of changing the cursor
conflicts with autoscrolling or drag-scrolling, but AFAIK there's no
way of preventing that interference directly.
DATE : Sun Apr 20 18:37:41 2008
On Apr 20, 2008, at 03:43, Ling Wang wrote:
> You can see the code at http://developer.apple.com/samplecode/DragItemAround/listing2.html
> on ADC.
>
> The bug is that the cursor reverts to arrowCursor if the item is
> dragged off the bound calculated at the mouseDown event just before
> current mouseDragged event, instead of staying closedHandCursor.
> Maybe it will be clear till you try to run it.
>
> It seems something happens when the mouse moves out of the cursor
> rect that is set for the item's bounds in resetCursorRects. This
> something is out of my knowledge, so I am hoping someone can tell me
> the cause of the bug and a canonical way to fix it, and I'll
> feedback the solution together with the bug on ADC after that.
Chances are, calling '[[self enclosingScrollView] setDocumentCursor:
[NSCursor closedHandCursor]]' in 'mouseDown:' will fix the problem
you're seeing. NSScrollView/NSClipView's way of changing the cursor
conflicts with autoscrolling or drag-scrolling, but AFAIK there's no
way of preventing that interference directly.
| Related mails | Author | Date |
|---|---|---|
| Ling Wang | Apr 20, 12:43 | |
| Jens Alfke | Apr 20, 18:06 | |
| Quincey Morris | Apr 20, 18:37 | |
| Ling Wang | Apr 21, 15:22 | |
| Jens Alfke | Apr 21, 16:41 | |
| Mike Wright | Apr 21, 17:48 | |
| an0 | Apr 23, 17:10 | |
| Quincey Morris | Apr 24, 00:44 | |
| Scott Anguish | Apr 24, 07:36 | |
| an0 | Apr 26, 17:47 | |
| Quincey Morris | Apr 26, 21:48 | |
| an0 | Apr 27, 08:14 | |
| an0 | Apr 27, 11:35 |






Cocoa mail archive

