• 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: Connecting menu item to controller in different nib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Connecting menu item to controller in different nib


  • Subject: Re: Connecting menu item to controller in different nib
  • From: Ondra Cada <email@hidden>
  • Date: Wed, 24 Jul 2002 17:34:39 +0200

On Wednesday, July 24, 2002, at 05:08 , Matthew Roberts wrote:

The main menubar is, of course, defined in the MainMenu nib. My problem is
that I want to connect one of that nib's menu items to an action on the
document's controller (which is the "File's Owner" object in the nib
window).

Ouch. Generally, check docs and archives, this very question is in both...

Well: connect the item(s) to the First Responder, and make sure the document controller understands the message. The rest (that always the controller of the main window is the one who gets the message if the menu item is selected) is ensured by White Cocoa Magic (if interested how the magic works, study NSResponder.html and NSDocument/Controller.html).
---
Ondra Hada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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:
    • Re: Connecting menu item to controller in different nib
      • From: Matthew Roberts <email@hidden>
References: 
 >Connecting menu item to controller in different nib (From: Matthew Roberts <email@hidden>)

  • Prev by Date: Connecting menu item to controller in different nib
  • Next by Date: Re: cycle through windows
  • Previous by thread: Connecting menu item to controller in different nib
  • Next by thread: Re: Connecting menu item to controller in different nib
  • Index(es):
    • Date
    • Thread