Re: [newbie] Handling a preferences window
Re: [newbie] Handling a preferences window
- Subject: Re: [newbie] Handling a preferences window
- From: James DiPalma <email@hidden>
- Date: Mon, 30 Sep 2002 19:19:21 -0400
From: Jeremy Dronfield <email@hidden>
I agree - your implementation of the design you've attributed to me
probably is less clean than your implementation of your own design.
However, I'm equally sure that my own implementation of the design I
would use for my own needs (which I didn't post) is quite adequately
efficient, thank you very much indeedy.
My sample code attributed to your suggestions follows each of these
points from your response to my mail:
"For newbies, NSWindowController is pretty useful as a File's Owner
class"
You "like the convenience of - initWithWindowNibName:"
-setWindowFrameAutosaveName: is "the handiest frame-saver in the
catalogue"
"[a newbie] will probably want to put it [preferences window and its
code] in a separate nib."
What I *did* suggest to the original poster was that they should:
1. Use -showWindow: if the window had a controller in MainMenu.nib;
Your original post (which I overlooked) makes these points:
A preferences controller should be a subclass of NSWindowController
Use -showWindow: to raise an NSWindowController's window
I think I now understand what you are suggesting:
1. Make a subclass of NSWindowController and instantiate it in
MainMenu.nib
2. Connect your preferences menu item to showWindow:
3. In NSWindowController's init method call initWithWindowNibName:
4. In NSWindowController's init method call setWindowFrameAutosaveName:
I like this suggestion. It may or may not be how you would implement
it, but it accurately takes your suggestions and preferences for
NSWindowController and shows how to implement a solution to this post's
original question.
I thought I was just mentioning what I like about window controllers
(which I admit is pretty offensive behaviour, for which I apologise).
Your 2 posts before this apology where in no way offensive. I would
like to see more information about: what your solution for loading a
preferences window is, why setShouldCascadeWindows: is surprisingly
useful for a preferences NSWindowController, and why subclassing
NSObject is for experienced developers and not newbies.
-jim
_______________________________________________
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.