Welcome page in doc-based app
I'm having some problems with document-based apps.. well, i managed to set up the app, using a window controller for the doc's window, and in that window i have some panels serving as inspectors, and now i realised i missed something!
I need some help for the following issues:
1) i want to make a splash screen (a window that appears when you open the app and loads some settings, like photoshop)
2) after the splash screen loads all the settings needed by the app, i don't want the app to load a new document.. could i change this behaviour ? why do i want that ? well, i want to load a window that shows the user some recent documents and a link for making a new document, so the user will create the new document, not the app (like dreamweaver's "welcome" page that shows up when the app has started, hides when the user chooses to create/open a document, and shows back up when the user closes all open documents)... i just need some guidelines, some hints on how i could do that..
Is it possible to make these things in a doc-based app ? or do i have
to make a window based app and hardcode it to simulate a doc-based app ?
I'm sure this is quite easy. For sure, you can write a little dialog box type application what would be your 'splash screen'. And a different application to run your 'document'. So the puzzle reduces to running them in sequence.
According to something I google'd, the function NSApplicationMain is equivalent of:
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
NSApplication *app = [NSApplication sharedApplication];
[NSBundle loadNibNamed:@"MainMenu" owner:app];
[app run];
}
So, I suppose you can use that code to run your 'splash screen nib', followed by the 'MainMenu' nib. Mind you, I've never tried this - however it seems reasonable.
As a last resort, you could have a 'splash screen.app' hidden inside your bundle and run it with system() before running the document main - however I'm sure you don't need to resort to such crude hackery!