At 4:35 PM -0500 11/6/08, Eric Gorr wrote:
On Nov 6, 2008, at 3:29 PM, [EMAIL PROTECTED] wrote:

At 12:02 PM -0800 11/6/08, ic  wrote:
Date: Thu, 6 Nov 2008 14:20:08 -0500
From: Eric Gorr <[EMAIL PROTECTED]>
Subject: Re: A finished moving notification for a window?
To: Cocoa Dev <[email protected]>
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes


On Nov 6, 2008, at 1:52 PM, Eric Gorr wrote:

It looks like the only way to get the behavior I want is to subclass NSWindow and override the mouse movement functions for the NSResponder.

Well, this just got a little more complicated.

The window does not mouseDown or mouseUp events if the user clicks in the title bar.

I found an old thread:

http://lists.apple.com/archives/cocoa-dev/2006/Oct/msg00141.html

related to this issue, but there was no solution posted to the mailing list.

i manage this with a subclass of nswindow as follows:
        register to receive the NSWindowWillMoveNotification notification
        upon receiving this notification, set an iVar windowIsMoving
        override send event as follows:


How, exactly, did you do this?

I have tried a couple of different things, but nothing seems to be working. If it matters (and I don't see why it should), I actually have a NSPanel.

In my delegate for the NSPanel, as a test, I tried defining:

- (void)windowWillMove:(NSNotification *)notification
{
  NSLog( @"windowWillMove" );
}

but this never gets called. I also defined windowDidMove and that gets called without any trouble. Any idea why windowWillMove would not get called?



Next, in the awakeFromNib method in my controller, I tried calling:

[[NSNotificationCenter defaultCenter] addObserver:myWindow selector:@selector(paletteWindowWillMove:) name:NSWindowWillMoveNotification object:nil];

but, the selector paletteWindowWillMove: in the subclass of my NSPanel, never gets called. Any idea why?

from my NSWindow subclass's awakeFromNib:

[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(beginMove:) name: NSWindowWillMoveNotification object: self];

i have no idea if this will work with panel's, but i would think it would as a panel is a subclass of a window, but you would obviously have to subclass NSPanel instead of NSWindow.

ken

_______________________________________________

Cocoa-dev mailing list ([email protected])

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

This email sent to [EMAIL PROTECTED]

Reply via email to