Re: NSMenu not displaying items added programmatically
Re: NSMenu not displaying items added programmatically
- Subject: Re: NSMenu not displaying items added programmatically
- From: "I. Savant" <email@hidden>
- Date: Thu, 10 May 2007 15:44:32 -0400
On 5/10/07, Patrick Hartling <email@hidden> wrote:
OK, that's definitely easier than I was expecting. The documentation I was
reading led me to believe that I was going to have to work harder than that,
and that is why I was trying to skip the use of NSDocumentController. Thanks
for the insight. It is a huge help.
You said you didn't realize it was an automatically-generated menu.
How, then, do you suppose the items got there? :-) If they got there,
something's maintaining them. It's best to find and control that
mechanism rather than try to barge in and mess with its stuff. Bad
things happen when that happens.
Say you want to add a service to the Services menu. Would you just
add a menu with the name of your service to the Services menu and
expect it to work? Of course not - the System Services are maintained
through a mechanism that builds the list and provides the menu. Simply
adding a view that says "My Address Book" won't get you the contents
of your address book. My point is something is in control ... and that
something is a controller. :-)
That said, you should (re)read the MVC (Model / View / Controller)
information in the Cocoa documentation and keep reading until you
fully understand it. Cocoa is designed according to this pattern, so
understanding it gives you a huge leg-up in understanding Cocoa
itself.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden