• 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: multiple windowcontrollers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: multiple windowcontrollers


  • Subject: Re: multiple windowcontrollers
  • From: Koen van der Drift <email@hidden>
  • Date: Thu, 24 Jun 2004 20:59:37 -0400

If you want to use a menu item to display the info window that belongs to the active document, then you should probably put the action for the menu item in your document class.

To make the connections for the menu in IB (since you can't make a connection directly to a document in the main nib) you make the connection to the "First Responder" object alias in the main nib file instead. This causes the action to be sent down the responder chain whenever the menu item is selected, and it will trigger the action in the active document which can display the info window (or create the controller if needed and display the window) for that document. That way the info window shown will always be the one from the active document and you don't have to deal with forwarding the message through your main controller.


This works fine, thanks. However, one document can now open more than one info windows. I can think of 2 solutions, either dim the menuitem if the info panel is already open, or make the windowcontroller an ivar of MyDocument, and check if it already exists in the action method. What would be the more logical approach?


thanks,

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


  • Follow-Ups:
    • Re: multiple windowcontrollers
      • From: Andreas Mayer <email@hidden>
    • Re: multiple windowcontrollers
      • From: "Louis C. Sacha" <email@hidden>
References: 
 >multiple windowcontrollers (From: Koen van der Drift <email@hidden>)
 >Re: multiple windowcontrollers (From: "Louis C. Sacha" <email@hidden>)
 >Re: multiple windowcontrollers (From: Koen van der Drift <email@hidden>)
 >Re: multiple windowcontrollers (From: "Louis C. Sacha" <email@hidden>)

  • Prev by Date: Re: Passing by reference
  • Next by Date: Re: figuring out the length of a string
  • Previous by thread: Re: multiple windowcontrollers
  • Next by thread: Re: multiple windowcontrollers
  • Index(es):
    • Date
    • Thread