Re: Use different window than File Owner's in NIB
Re: Use different window than File Owner's in NIB
- Subject: Re: Use different window than File Owner's in NIB
- From: 陳銘崧(James Chen) <email@hidden>
- Date: Tue, 6 Jul 2004 09:45:44 +0800
Hi,
Now you have two controllers, one is from outside (file owner, let's
call it A) and the other (Let's call it B) is created from nib, right?
I think you could temporally add a outlet, which connect to the other
controller in nib, in your controller class.
That is,
A.m_TheOtherController --------> B and
B.m_TheOtherController --------> A
So that A could send a message to B to order front B's window and then
order out its' window, vice versa.
In the other hand, you may create two(or more) nib files, each of them
represents one style of your GUI.
And Load the nib file at run time dynamically by using [NSBundle
loadNibNamed:owner:] or something like that.
For example,
The controller load the AWindow.nib at startup.
When you want to switch to B window, clean up stuff for A and load
BWindow.nib.
Or you could create multiple instances of your Controller Class. and
each of them loads its nib respectively.
For instance,
Let Controller A show its window at startup.
When you want to switch to B window, message Controller A to hide A
window and message Controller B to show B Window.
In this paradigm, maybe you need a third controller to control over
Controller A and B.
I prefer third option. Because it keeps the code of controller as
closer as the final. It has no extra "control" or "clean up" code.
HTH,
James
------------------------------------
Ulead Systems Inc.
James Chen
Software Engineer
Image Div.
------------------------------------
On Jul 6, 2004, at 6:00 AM, David Bainbridge wrote:
I have a basic question:
I have a window that is displayed by setting the File Owner's custom
class setting. I have another window that uses the same controller
class but has a different layout in the same nib file. I am doing
this to see which layout of the window using the same controller class
works best for the user. I instantiated a new subclass for the
controller for the second window but am missing how to have my code
use that controller instead of the File Owner's... or in other words
how do I simply switch between the two windows from code/IB?
_______________________________________________
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.
_______________________________________________
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.