Re: one document at a time
Re: one document at a time
- Subject: Re: one document at a time
- From: Jeff LaMarche <email@hidden>
- Date: Tue, 14 Dec 2004 17:22:18 -0500
On Dec 14, 2004, at 5:07 PM, Jiri Volejnik wrote:
I need to modify my app so that only one document at a time can be
opened. If there is some document already opened, it should be closed
and its windows reused. What way would you suggest to go? I was
thinking about subclassing NSDocumentController, but maybe it's not
necessary?
Well, before anything, I'd suggest you think through this. As an end
user, I find the one-document restriction annoying in most applications
that use it. I have trouble seeing why Quicktime Player allows multiple
movies, but Windows Media Player allows only one, for example. There
are some cases where it seems to make sense, though.
So, if you're sure it's the right thing to do, I would suggest that the
easiest thing is to simply gray the "new document" menu item when a
document is opened or created, and enable it when there a document is
closed. With the "open document" option, you should ask to save, close
without saving, or cancel before presenting the standard open dialog.
This requires a relatively minimal amount of code, and is fairly easy
to back out should you decide to support multiple documents in the
future.
_______________________________________________
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