On Sep 12, 2008, at 12:17 PM, Brad Gibbs wrote:

I want to write the code to switch views in the MainWindowController.m, since it controls the window that contains the views that will be switched. But, the buttons that control the view switching are located on a panel being controlled by a different view controller.


So you have the buttons on the navigation panel, that control the main window view. You have a few options:

1) Connect the buttons on the panel to the changeView: (or whatever you call it) actions on the main window windowController. This is the easiest. Just leave your Navigation Panel in your main windows nib, and don't bother writing a window controller for it. If the navigation panel starts getting more complicated and chatty with a bunch of other components, or particularly if it can alter document state, THEN consider making a separate NIB for it.

2) Implement changeView: on your Document class instead, and make the buttons on the panel send a changeView: selector to the first responder. The changeView: message will eventually find its way to your NSDocument, and then you write code in the NSDocument that tells the MainWindowController to do the view switching. All roads in the responder chain lead to the NSDocument eventually.

Jamie Hardt
The Sound Department
http://www.soundepartment.com/
http://www.imdb.com/name/nm0362504/

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to