• 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: -[NSResponder flagsChanged:] not called?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -[NSResponder flagsChanged:] not called?


  • Subject: Re: -[NSResponder flagsChanged:] not called?
  • From: Matt Neuburg <email@hidden>
  • Date: Fri, 14 Jun 2002 10:48:05 -0700

On Thu, 13 Jun 2002 01:12:43 +0200, Marco Scheurer <email@hidden> said:

>I've got to admit I was wrong: I was thinking window controller
>(NSWindowController) and wrote delegate. For the window's delegate to
>catch event messages, it should be a subclass of NSResponder and be set
>as the window's nextResponder (and it being the delegate is then of
>course irrelevant).

Right. There are several confusions into which one can fall here. First,
there is the Lesser Responder Chain vs. the Greater Responder Chain; the
Greater (for nil-targeted action messages) has the delegate hard-wired into
it, but the Lesser (for user events) does not. Second, in a typical
doc-based app, a window's NSWindowController is the File's Owner and is
therefore also set up by default as the window's delegate; but in that case
it receives flagsChanged: qua NSWindowController, not qua delegate.

>So it looks like your test was not wrong if what you tested was my first
>assertion, and I apologize.

Fine.

>Of course, there are times when subclassing NSWindow is the solution,
>but in that case, I still think that it was bad advice.

I didn't mean to advise anything, really. The OP seemed to think that
flagsChanged: was just plain broken; I wanted to tell him that it wasn't,
since my app catches it just fine, and to tell him how this was
implemented. In the case of my app, where I want to receive flagsChanged:
just exactly in case a certain window is frontmost, I think subclassing
NSWindow is perfectly appropriate and the simplest solution. Not every app
is doc-based and not every window has or needs an NSWindowController
subclass, after all. I didn't mean to imply this was the only way or the
best way in all circumstances; I simply wanted to provide a way that I knew
worked, so that the OP could prove to himself quickly that the feature was
operating. m.
--

matt neuburg, phd = email@hidden, http://www.tidbits.com/matt
pantes anthropoi tou eidenai oregontai phusei
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
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.

  • Follow-Ups:
    • Recognizing a 'folder' as a document type?
      • From: email@hidden
  • Prev by Date: data->array (!@%$*)
  • Next by Date: Re: Object from TableView cell
  • Previous by thread: Re: -[NSResponder flagsChanged:] not called?
  • Next by thread: Recognizing a 'folder' as a document type?
  • Index(es):
    • Date
    • Thread