• 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: Menu synchronization
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Menu synchronization


  • Subject: Re: Menu synchronization
  • From: PGM <email@hidden>
  • Date: Sun, 29 Oct 2006 20:49:24 -0500

If you register your document for the windowDidBecomeKeyNotification there is the parameter "object:". If you pass nil here, the notification will be passed to all documents whenever a window becomes key. If you pass for every document [[[self windowControllers] objectAtIndex:0] window] the notification will only be sent to a document when its own window becomes key.

Cheers, Patrick


On 29-Oct-06, at 16:33 PM, James Pengra wrote:

I'm working on a multi-document application where one of the menus (a submenu) is changed as things (lens images in this case) are added to the document. With more than one documents open, I would like the menu to correspond to the top or key document window. There must be a standard or accepted way to manage this.

I finally figured out a kludge that works using the notification NSWindowDidBecomeKeyNotification but, since the notification goes to all instances of the Document (one for each open window), I had to make sure that the window in question corresponded to its proper Document.

Could someone point me to some sample code or documentation that shows the proper way to handle this.

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


This email sent to email@hidden

_______________________________________________ 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: 
 >Menu synchronization (From: James Pengra <email@hidden>)

  • Prev by Date: Re: How to provide a custom name for an untitled document?
  • Next by Date: Re: newbie problems with master-detail relationship
  • Previous by thread: Re: Menu synchronization
  • Next by thread: Re: Ripple Transition Timing
  • Index(es):
    • Date
    • Thread