• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Custom window not getting delegate notifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Custom window not getting delegate notifications (From: j o a r <email@hidden>)

  • Prev by Date: Re: Custom window not getting delegate notifications
  • Next by Date: Re: replacing self in initWithCoder method? {advanced}
  • Previous by thread: Re: Custom window not getting delegate notifications
  • Next by thread: Text Color in NSButton?
  • Index(es):
    • Date
    • Thread