Re: Showing a window from a second nib
Re: Showing a window from a second nib
- Subject: Re: Showing a window from a second nib
- From: Tom Harrington <email@hidden>
- Date: Sun, 06 Jan 2002 17:12:21 -0700
email@hidden wrote:
Make AboutController be a subclass of NSWindowController instead of
NSObject, then window will already be declared as an outlet and
showWindow: will already be implemented.
Then load the nib in when you construct the controller, not in showWindow.
Heh, I see I'm not the only reader of this list who's reading Aaron
Hillegass's book right now. :-)
<snip details>
ps. if your window is just an about box, that really has no target
methods, you don't even need to write a controller... just use
NSWindowController, and hook everything up in IB to allow a button to
close it.
I also wrote this using a controller class, mainly because that's how
this "challenge" problem was stated. I'd like to try your approach here
but I'm not sure I understand it. Obviously the nib file can be loaded
without a controller class, but if so, how would I connect the
"About..." menu item to the display of the box? I did it by setting the
menu item's "target" outlet to call a specific method in the controller,
which then sends -makeKeyAndOrderFront:self to the panel. I'm not sure
how I'd make this link without a controller.
--
Tom Harrington, Cybernetic Entomologist
email@hidden