Re: Custom window not getting delegate notifications
Re: Custom window not getting delegate notifications
- Subject: Re: Custom window not getting delegate notifications
- From: John Scalo <email@hidden>
- Date: Wed, 27 Nov 2002 23:46:18 -0800
On 11/27/02 11:29 PM, "j o a r" <email@hidden> wrote:
>
4) Is your window borderless? In that case it will not automatically
>
accept to become key - you need to override that method from NSWindow
>
(more on this in the archives). If it never becomes key, you'll never
>
get the notifications... :)
Bingo! I didn't realize that. Overriding those methods to return YES did the
trick. Thanks!
>
>
On Thursday, Nov 28, 2002, at 07:56 Europe/Stockholm, John Scalo wrote:
>
>
> I have a custom window for which I call [self setDelegate:self] during
>
> the
>
> initWithContentRect method. However, the window's delegate methods
>
> such as
>
> windowDidBecomeKey, windowDidBecomeMain, etc never get called.
>
> According to
>
> the docs, "an NSWindow's delegate is automatically registered for all
>
> notifications that it has methods for" so it seems they should work.
>
>
>
> Now I know I could explicitly register for those notifications with
>
> NSNotificationCenter, but that's not ideal because I'll get
>
> notifications
>
> for every window, not just this one.
>
>
>
> FWIW, I did search the archives and found one identical question with
>
> no
>
> answers.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.