Re: How to add items with actions to the main menu
Re: How to add items with actions to the main menu
- Subject: Re: How to add items with actions to the main menu
- From: Lynn Barton <email@hidden>
- Date: Sun, 27 Jul 2008 21:21:16 -0700
- Thread-topic: How to add items with actions to the main menu
Title: Re: How to add items with actions to the main menu
Thanks, Kevin; that worked, up to a point. (I use Xcode 3.0 with NIBs, not XIBs.) My new menu item is disabled, even though the enabled box in the inspector is checked.
Lynn Barton
On 7/22/08 9:31 AM, "Kevin Cathey" <email@hidden> wrote:
Lynn,
You would add the menu item in your MainMenu XIB file. In the same file, add an action to First Responder with the name of your action (e.g. importDataFromTextFile: or something). Then, connect the new menu item to First Responder. In any class in your responder chain, though most likely and most encouraged in the window controller, you would implement your importDataFromTextFile: method.
Does that make sense?
Kevin
--------------------------
Kevin Cathey
On Jul 21, 2008, at 8:59 PM, Lynn Barton wrote:
I am building a core data document-based application very similar to the one in the NSPersistentDocumentTutorial. I want to make some changes to the Main Menu. I want to insert a new menu item (easy enough) for importing data from a text file. How do I define the action message and its target? Where should I put the code to respond to that message and import the data?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden