Re: Multiple Window Application...
Re: Multiple Window Application...
- Subject: Re: Multiple Window Application...
- From: "M. Uli Kusterer" <email@hidden>
- Date: Sun, 5 Oct 2003 16:38:09 +0200
At 19:23 Uhr -0500 04.10.2003, James McConnell wrote:
Just so you all know where I'm coming from, I'm originally a Java developer,
and I plain got sick of having to struggle to come up with nice looking
interfaces, so I'm looking at Cocoa, and yes, I will stick with Objective-C,
not Cocoa/Java.
Smart decision.
Now, in Cocoa, all the examples I've seen involve small projects with only
one window. You create it in IB, create a controller class that contains
all the outlets and actions. How would I handle more than one window?
Let me summarize the gist of the answers you received in the thread
archived at
http://cocoa.mamasam.com/COCOADEV/2003/09/1/72552.php
for posterity:
-> Create both windows in a NIB file
-> Give the file's owner owner an outlet pointing to your second
window (You should already have an outlet hooked up to the first
window).
-> Make sure the second window is marked as initially invisible
(visible at startup checkbox to OFF, or whatever the exact name is)
-> Make sure the second window is checked not to be released when
closed (it will only be hidden, i.e. orderOut: will be called on it)
-> When you want to show the window, use the outlet to get at the
window to set up its initial values, and use orderFront: or
makeKeyAndOrderFront: to actually show it.
This will obviously work only if you want a single window. If you
want to open several windows of this style independently, you should
look into document-based applications, making the main window a list
of files that opens documents for each file.
If there is no relationship between these windows and files, you
should look into subclassing an NSWindowController, or using
NSNibLoading directly to fake the behavior of NSDocument and
NSWindowController for your special case.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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.