• 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: Info window scenario
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Info window scenario


  • Subject: Re: Info window scenario
  • From: Julien Jalon <email@hidden>
  • Date: Tue, 6 Nov 2001 16:05:29 +0100

Le mardi 6 novembre 2001, ` 11:30 PM, e.sammer a icrit :
[[[[notification object] windowController] document] isMemberOfClass:[MyDocument class]]

and if so, doing [[InfoController sharedInfo] setCurrentDocument:theDoc]. then, the apply button can work because i have a reference to the current document.


It is the good idea and this is not a hack... but I would register BecomeMainWindow instead of BecomeKeyWindow. In a document based application, only documents windows become main (except if you create special windows that can)

And, I would test windowController instead if you use a custom window controller :

[[[notification object] windowController] isMemberOfClass:[MyWindowController class]]

Using notification is the most elegant way... the documents don't have to know about any inspectors. The inspectors are tools to modify the document, they have to know about documents.

An other use of Notifications for inspectors: whenever the document changes, it send a homemade notification to the notification center that the inspector is observing. The inspector, then, ask for the documents new properties.

With notifications, you can implement other inspectors, other panels without changing a single character in the document/windowController code.

--Julien


References: 
 >Info window scenario (From: "e.sammer" <email@hidden>)

  • Prev by Date: Re: Newbie, Q about files
  • Next by Date: Bug in setKeyEquivalentMask:?
  • Previous by thread: Info window scenario
  • Next by thread: Re: Info window scenario
  • Index(es):
    • Date
    • Thread