Re: multiple windowcontrollers
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.