I've been following some Apple sample code with respect to mouse
dragging logic (within a table - but that's probably not important).
The particular approach involves maintaining full control of the drag
state by starting a loop that processes all pertinent events until the
mouse button is released.
By and large this works fine, you can watch and react to the events
during the drag operation and you can dispatch events for 'normal'
processing as necessary with:
[NSApp sendEvent:event];
Now, I need to handle dragging beyond the bounds of the originating
view because I wish to implement auto-scrolling during the drag. This
actually works great using NSPeriodic events.
There's one fly in the ointment however. When the mouse leaves the
bounds of the view, I correctly get an NSMouseExited event from the
tracking area that is set up. However, when the mouse reenters the
view/tracking area, still under drag, I get an NSMouseEntered, but the
window is nil. This causes grief, and is in contrast with a
NSMouseEntered events that happen when I'm not managing the drag.
I'm wondering if I'm missing a way to lock the window as the event
target while I'm dragging (after all, code associated with this window
is 'in control' at this point and making decisions about the meaning
of all mouse movement).
Various ideas for hacking a solution present themselves (after all, at
least I'm not _missing_ the event entirely), but I'm inclined to
believe that the source of my angst is likely correctable by more
respectable, and/or canonical means.
Cheers
-- Luke
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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/archive%40mail-archive.com
This email sent to arch...@mail-archive.com