On Mar 12, 2013, at 3:11 PM, Steve Mills wrote:

> What's the best way to go about snapping windows to screens and other windows 
> while dragging the window? I've tried catching it in windowDidMove (only when 
> the mouse is down), but that isn't called for every single movement of the 
> mouse. I haven't been able to find anything equivalent to the old 
> kEventWindowBoundsChanging with kWindowBoundsChangeUserDrag, which was 
> exactly what was needed to do this. It needs to be available in 10.7 on up.

The Window Server moves most windows entirely without involving the app (until 
the move is completed).  If you want to change how windows get moved, I think 
you have to take over the whole process.  You do [window setMovable:NO] to make 
the Window Server not move your windows itself.  Instead, you get the relevant 
mouse events and you write typical mouse drag code and change the window frame 
manually.  See the docs for -[NSWindow isMovable].

Regards,
Ken


_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to