Re: Snapping windows while moving
Re: Snapping windows while moving
- Subject: Re: Snapping windows while moving
- From: Seth Willits <email@hidden>
- Date: Wed, 13 Mar 2013 16:26:01 -0700
On Mar 12, 2013, at 1:54 PM, Steve Mills wrote:
>> Pretty sure you want to subclass and override constrainFrameRect:toScreen: but I can't recall off the top of my head whether this is called live for every movement. I believe it is.
>
> Nope. It only seems to be called when the window is being created and *after* the mouse has been released during a move.
Oh I see. I was thinking of the -windowWillResize:toSize: delegate method which is called live for resizes.
On Mar 13, 2013, at 6:06 AM, Tamas Nagy wrote:
>> And you're seeing that getting called for every single movement of the mouse?
>
> Exactly.
I definitely do not. I suspect Tamas misinterpreted the question?
On Mar 13, 2013, at 8:34 AM, Ken Thomases wrote:
> The Window Server moves most windows entirely without involving the app (until the move is completed).
Minor detail… while the window is being moved the app has no idea it's happening, but after the movement stops for some brief time (the mouse button can *still be held down*) the window's frame is changed. That is, while the mouse button is held down, the window frame *does* update, but only after the mouse has stopped moving for some short amount of time. The frame change happens transparently though — no calls to any setFrame method is made (and no notifications happen etc). So it's still useless, but it's interesting.
> 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 too think this the only option.
-- Seth
_______________________________________________
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