• 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: Files owner vs MyController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Files owner vs MyController


  • Subject: Re: Files owner vs MyController
  • From: Sherm Pendley <email@hidden>
  • Date: Sun, 25 Apr 2004 16:40:56 -0400

On Apr 25, 2004, at 4:19 PM, Ken Tozier wrote:

Another related question is that it doesn't seem possible to assign actions to menu items. Intuitivatively, selecting a menu item is an action so I would think that when wiring it up to either the controller or the files owner, that the direction would flow from the menu item to the controller, but that doesn't seem to be possible.

Menu actions are most often sent to the "Responder Chain" rather than to a specific object. In IB this means connecting them to "First Responder" instead of "Nib's Owner". Programatically it means passing nil to setTarget:.

If you want a window controller to respond to menu selections when its window is the key and/or main window, make the controller the window object's delegate.

More details about event handling and the responder chain are here:

<http://developer.apple.com/documentation/Cocoa/Conceptual/ BasicEventHandling/index.html>

sherm--
_______________________________________________
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.


References: 
 >Re: Files owner vs MyController (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: Java_com_apple_cocoa_application_NSText_scrollRangeToVisible
  • Next by Date: How to put together 21 chunks of XCode 1.2?
  • Previous by thread: Re: Files owner vs MyController
  • Next by thread: Re: xCode 1.2
  • Index(es):
    • Date
    • Thread