• 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: Document notifications?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Document notifications?


  • Subject: Re: Document notifications?
  • From: "John C. Warner" <email@hidden>
  • Date: Mon, 25 Apr 2005 22:45:18 -0400


On 25 Apr, 2005, at 10:11 PM, Mark Dawson wrote:

In my preference window, I'd like to know when documents change--added, deleted (closed), change to becoming the "current" document, and when their title's (displayName) change. In my case, there is a 1:1 correspondence between a document and window (i.e., there is only one window for a document).

Is this functionality something I need to add in, or is it available already? I didn't see anything off hand in NSDocument or NSDocumentController in regards to the above notifications.

If I DO need to add the functionality, I figure I can listen for the window's NSWindowDidResignMainNotification event, which should catch the add, close, and change-from-current-doc cases. It seems the only thing I would have to add is maybe a category to NSWindow's setDisplayName that brodcast's a notification…

You could subscribe to the windows' NSWindowDidBecomeMainNotification or NSWindowDidBecomeKeyNotification, and get the document from the notifying window's windowController.

That sounds like it'd work.

-John
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Document notifications? (From: Mark Dawson <email@hidden>)

  • Prev by Date: bind, unbind and retainCount problems
  • Next by Date: Re: bind, unbind and retainCount problems
  • Previous by thread: Document notifications?
  • Next by thread: bind, unbind and retainCount problems
  • Index(es):
    • Date
    • Thread