Re: Very simple Cocoa question
Re: Very simple Cocoa question
- Subject: Re: Very simple Cocoa question
- From: "John C. Randolph" <email@hidden>
- Date: Tue, 3 Jul 2001 10:51:05 -0700
On Tuesday, July 3, 2001, at 10:33 AM, Doug wrote:
Doug Wrote:
Hello everyone! I'm new to this list. I'm trying to figure out how to
make
my application make it so a certain window does not appear in the
windows
menu when I open it. I noticed that to do this I need to send the
message:
setExcludedFromWindowsMenu:YES to the window. I know how to send the
message, but I don't know when to send the message. I tried putting it
in my
main function but the window was undefined.
There are a few options for this. The best way is probably to have a
single instance of your main, controller class in the main nib file and
connect it to the "delegate" outlet in "File's Owner" which is by
default set to NSApplication. Then, implement
-applicationDidFinishLaunching in you controller class and it will be
called by NSApplication once it finishes launching the app.
For future reference, these are the functions most useful in doing
intialization work once a .nib file has been loaded.
Ah, ok...Thanks...that reference I snipped is handy too! I just tried
to do
this but now Interface Builder is saying that the window is undefined.
How
do I refer to a window I created in IB within my program? I need to
send a
message to my window, but I created it in Interface Builder so I don't
know
how to get an NSWindow pointer to send it to within my code.
Add an instance variable (an "outlet", in IB parlance) to whatever class
contains the code that you want to talk to the window. Make an instance
of said class. Connect the outlet to the window.
-jcr
"The right to be heard does not include the right to be taken
seriously." - Hubert Humphrey