• 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: Getting a reference to an NSMenuItem from another nib?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting a reference to an NSMenuItem from another nib?


  • Subject: Re: Getting a reference to an NSMenuItem from another nib?
  • From: "Theodore H. Smith" <email@hidden>
  • Date: Tue, 14 Jun 2005 17:13:24 +0100

Most importantly, the validateMenuItem: message is only sent to an
object if that object is in the responder chain and it implements the
action associated with the menu item.

Consider a "Copy" menu item.  There may be many ways in which a user
can select an item in the user interface and make a copy.  If you
consolidate all your menu validation code into a single app
controller, how will you determine whether or not the copy menu item
should be enabled?  Rather than the locus of control being in the
object best able to make that decision (the one implementing the
relevant action method), your app controller must now determine what
is the current focus, what possible actions there are, whether they
are valid and so on.  Which is likely to translate into a large if/
then table...

Yeah. It is best that the menu enabling code moves through the relevant responders. I think then that the way that Cocoa is designed is what I'll have to go with. I personally might have designed Cocoa in such a way that if-tables were unnecessary for menus... but maybe there is still a way to make it unnecessary, as some poster here suggested.


--
http://elfdata.com/plugin/ Industrial strength string processing, made easy.


"All things are logical. Putting free-will in the slot for premises in
a logical system, makes all of life both understandable, and free."

_______________________________________________
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


  • Follow-Ups:
    • Re: Getting a reference to an NSMenuItem from another nib?
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: Re: Getting a reference to an NSMenuItem from another nib?
  • Next by Date: Re: Getting a reference to an NSMenuItem from another nib?
  • Previous by thread: Re: Getting a reference to an NSMenuItem from another nib?
  • Next by thread: Re: Getting a reference to an NSMenuItem from another nib?
  • Index(es):
    • Date
    • Thread