Re: [newbie] Handling a preferences window
Re: [newbie] Handling a preferences window
- Subject: Re: [newbie] Handling a preferences window
- From: Jeremy Dronfield <email@hidden>
- Date: Mon, 30 Sep 2002 12:39:23 +0100
On Monday, September 30, 2002, at 02:57 am, James DiPalma wrote:
For non-document windows, NSWindowController has little value beyond
releasing top-level objects when its window is closed. I can do this
release too.
Depends on level of expertise, individual programming practice etc.
Inherently, NSWindowController has quite a bit of built-in value, if it
suits you. For newbies at least (especially newbies who need to ask how
to open a window), NSWindowController is pretty useful as a File's Owner
class. For the more experienced, an NSObject subclass may ring your bell.
If you feel comfortable using NSWindowController and it works for you,
then it works for you.
I tend to stick with window controllers because I like the convenience
of - initWithWindowNibName:, - setShouldCascadeWindows: (surprisingly
useful even with non-doc windows) and -setWindowFrameAutosaveName:
(which I find the handiest frame-saver in the catalogue).
From: Yann Bizeul <email@hidden>
TSMPrefs is not a subclass of NSWindowController ;-) I finally decided
to not create a subclass in IB just to handle open and close. So you
think I should ?
If opening and closing is all your prefs window does, then no - leave
the whole thing in the main nib and put [myPrefsWindow
makeKeyAndOrderFront:nil] in your action method. If it does more than
that (i.e. allowing the user to set some application preferences), then
you'll have to write code to handle that as well, and will probably want
to put it in a separate nib. Before you attempt that, however, you
really should study the Cocoa documentation and do some tutorials. There
are some good ones out there, most of which have been mentioned on this
list in the past couple of weeks.
Good luck.
-Jeremy
========================================
email@hidden // email@hidden
The Alchemy Pages:
- fractious fiction at
http://freespace.virgin.net/jeremy.dronfield
========================================
_______________________________________________
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.