Re: Stop dragging my <NSWindow> around
Re: Stop dragging my <NSWindow> around
- Subject: Re: Stop dragging my <NSWindow> around
- From: Edward Hillenbrand <email@hidden>
- Date: Thu, 3 Feb 2005 11:58:34 -0700
On Feb 3, 2005, at 6:32 AM, Ken Tabb wrote:
I'm still trying to implement window snap-to-edge functionality with
my panels (further to my "mouseDown/Up on window's titlebar?" post).
Although the window doesn't get mouseDown / mouseUp called by default
when you click / release the titlebar, overriding your window's
-sendEvent: allows you to catch all mouseDowns / mouseUps.
I have been trying to figure out how to do this since you told me you
had already seen the code from iratescotsman.com
Here is what I have come up with, your app doesn't control window
movement, the window server does.
I tried overriding -mouseDragged: to start a modal event loop there,
but it didn't work the window edge would drag off screen and then
bounce in to place at the edge of the screen. My code looked something
like this:
Something was handling the events before being sent to my window or
app. I figured out they where being handled before the got to my app
by starting an infinite loop and then dragging the window around the
screen. Try adding this to your windows delegate:
- (void)windowDidBecomeKey:(NSNotification *)aNotification
{
for(;;);
}
Window movement still works, and that is because the windows server
handles it, you never even get a chance to implement custom window
movement so long as you use the standard title bar.
And as far as I can tell there is no way to tell the window server that
you want to handle window movement yourself. I hope I'm wrong about
all this maybe someone else has the solution, but it looks like the
only way to do it is with a fake title bar.
-- Edward Hillenbrand
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden