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 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 ?
There's really nothing different between a document based app and one that isn't. The difference is that in one, you use the document classes and in the other, you simply don't.
All you need to do is implement some of the NSApplication delegate methods such as applicationWillFinishLaunching: and applicationOpenUntitledFile: and do the appropriate logic there since those are called at the times you need.
All you need to do is implement some of the NSApplication delegate methods such as applicationWillFinishLaunching: and applicationOpenUntitledFile: and do the appropriate logic there since those are called at the times you need.
A look at this might help you out: http://oreilly.com/pub/a/mac/2002/06/14/cocoa.html
Hairball183 Wrote:A look at this might help you out: http://oreilly.com/pub/a/mac/2002/06/14/cocoa.html
wow, i've read so many mac dev books, but this one slipped through my fingers! thanks mate, really appreciate it! you're a life saver!
Hairball183 Wrote:A look at this might help you out: http://oreilly.com/pub/a/mac/2002/06/14/cocoa.html
btw, what's the name of the book from that link you gave me ?
hmm, i've stumbled across another problem... i managed to load a welcome window at every startup of the app, the user can open multiple documents of different types, but now i wanna catch some kind of event that triggers when the user closes the last opened document so that i can redisplay the welcome window.. is there such an event ? or do i have to override the document's canCloseDocumentWithDelegate method where i would check if it's the last opened document ? (and if so, how do i check if it's the last opened document ?)
I'd override the NSDocumentController removeDocument: method, but personally I'd advise against reopening the welcome window immediately after the document is closed.