Re: start window inside and NSDocument based application
Re: start window inside and NSDocument based application
- Subject: Re: start window inside and NSDocument based application
- From: Benjamin Dunton <email@hidden>
- Date: Wed, 4 Jan 2006 20:19:08 -0500
Excellent. Thank you very much. This makes perfect since. The
missing part for me was assigning a delegate to my NSApplication.
Now, I do not have a subclass of NSApplication (currently). Should
I ? I would handle most of the notifications in my AppDelegate.m
file correct? So could I just create the delegate, and assign it to
the File's Owner (NSApplication) in the MainMenu.nib file?
Thanks again,
Ben
On Jan 4, 2006, at 12:39 PM, Patrick Meirmans wrote:
Here's how I would do it (so not necessarily the best way):
-If your NSApplication subclass has no delegate, create a new class
to be the delegate of your NSApplication subclass.
-To not open an empty document on launch, let this delegate return
NO for the delegate method: applicationShouldOpenUntitledFile:
-You can now display your start window. A logical way to do so
would be using the applicationDidFinishLaunching: notification.
-To also display the start window when there are no more empty
windows, i.e. when the user closes the last window, you can simply
register for a NSWindowWillCloseNotification and count the number
of remaining visible windows.
Best, Patrick
On 3 Jan, 2006, at 21:54, Benjamin Dunton wrote:
All,
I am trying to figure out how to have a start window (a window
that would allow the user to open a previous document, create new
document, e.g. iMovie when you launch). I want this to be the
starting point for the user. Also, when no document windows are
open, I want this window to appear. How do I shoe horn this in
before the NSDocumentController creates a NSDocument?
Thanks,
Ben
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40sympatico.ca
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden