Re: Notification Sent When Window Is Ordered Back?
Re: Notification Sent When Window Is Ordered Back?
- Subject: Re: Notification Sent When Window Is Ordered Back?
- From: "email@hidden" <email@hidden>
- Date: Sun, 14 Dec 2008 17:18:57 +0000
ok... so here's a strange issue:
resigning the key window works fine
-=-=-=-
- (void)resignKeyWindow
{
NSLog (@"Out");
}
-=-=-=-
but if i also include the following method, resignKeyWindow no longer
works, and i only receive logs for becomeKeyWindow:
-=-=-=-
- (void)becomeKeyWindow
{
NSLog (@"In");
}
-=-=-=-
You seem a bit mixed up here (but then it is Cocoa).
Have you subclassed NSWindow or are you using a delegate?
SubClassing NSWindow is tricker than using the delegate approach.
-becomeKeyWindow is not a delegate method but a class method.
If you override it in an NSWindow subclass and don't pass it on to the
super class you will muck up the window handling.
You don't need to read the Cocoa docs you need to inject them into
your bloodstream!
writing instead becomeMainWindow works better, but in order for it to
work i need to set canBecomeKeyWindow:NO on all the other windows
produced by this window (like the NSColorPanel)...
On Sun, Dec 14, 2008 at 11:34 AM, James Bucanek <email@hidden
> wrote:
Chunk 1978 <mailto:email@hidden> wrote (Sunday, December 14,
2008 8:28 AM -0500):
honest to god, i have zero idea why this isn't working...
- (void)windowDidResignKey:(NSNotification *)notification
{
NSLog(@"window resigned key");
}
Probably because it's resignKeyWindow: not windowDidResignKey:
--
James Bucanek
_______________________________________________
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
Jonathan Mitchell
Central Conscious Unit
http://www.mugginsoft.com
_______________________________________________
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