Re: Snapping windows while moving
Re: Snapping windows while moving
- Subject: Re: Snapping windows while moving
- From: Ken Thomases <email@hidden>
- Date: Wed, 13 Mar 2013 10:34:35 -0500
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 (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