Re: Snapping windows while moving
Re: Snapping windows while moving
- Subject: Re: Snapping windows while moving
- From: Steve Mills <email@hidden>
- Date: Sat, 23 Mar 2013 00:18:41 -0500
On Mar 13, 2013, at 10:34:35, Ken Thomases <email@hidden> wrote:
> 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].
I'm getting back to this now. The window being dragged is an NSPanel. I've subclassed it so I could catch mouseDown, mouseDragged, and mouseUp. I also return NO from isMovable. The problem is, when I click in the titlebar, neither mouseDown nor mouseUp get called, only mouseDragged. This makes it impossible to know the starting position so I can move the window. Seems like a bug. Is there any way to get mouseDown and mouseUp in the titlebar?
--
Steve Mills
office: 952-818-3871
home: 952-401-6255
cell: 612-803-6157
_______________________________________________
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