• 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: [NEWBIE] Multi Nib help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NEWBIE] Multi Nib help


  • Subject: Re: [NEWBIE] Multi Nib help
  • From: "Carlos A. Weber" <email@hidden>
  • Date: Tue, 3 Sep 2002 06:10:18 -1000

On Monday, Sep 2, 2002, at 16:33 Pacific/Honolulu, Daniel Howard wrote:

Hey all,

Well, I'm starting to learn Cocoa (I've got quite a bit of understanding) but there are some things that I just don't grasp. For instance, my biggest hurdle right now is trying to show a drawer in a different nib file then the one that is calling it. i.e. In 'MainMenu.nib' I have a menu item called 'Show Drawer' and in 'MyDocument.nib' I have the actual drawer. How do I go about displaying the drawer? I've looked through the SimpleMultiWindow example, but it doesn't do what I want and I don't know how to change it to do what I want. I've spent literally a week working on this, and getting no where. I got it working with a NSNotification BUT the drawer would open in close inside of all documents that were shown (not the desired effect).

You might get flamed for asking this, because, once grasped, this seems so easy; variations on this same question have indeed been asked and answered many times over on this list. (Hint: do you know about the very accessible archives of this list AND Omni's macosx-dev list at http://cocoa.mamasam.com ??) Here's what you need to do:

1. Read about the responder chain. It's at the following url on your hard disk:
file:///Developer/Documentation/Cocoa/TasksAndConcepts/ ProgrammingTopics/BasicEventHandling/index.html

2. Assuming that the method which is actually going to display that drawer belongs to your MyDocument.nib's controller object, make that object the delegate of the window hosting the drawer. Do this using the "File's Owner" icon in IB. This gets your controller class into the responder chain (see #1 above).

3. Add an action with the same name as your method to the First Responder in MainMenu.nib, and connect your menu item to that action.

4. That's it.
_______________________________________________
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: 
 >[NEWBIE] Multi Nib help (From: Daniel Howard <email@hidden>)

  • Prev by Date: The macs serial number (clearer)
  • Next by Date: Re: [NEWBIE] Multi Nib help
  • Previous by thread: [NEWBIE] Multi Nib help
  • Next by thread: Re: [NEWBIE] Multi Nib help
  • Index(es):
    • Date
    • Thread