Re: Document-based app
Re: Document-based app
- Subject: Re: Document-based app
- From: Camillo Lugaresi <email@hidden>
- Date: Thu, 29 Dec 2005 16:00:04 +0100
On 29/dic/05, at 05:38, Laurent Michel wrote:
Hi!
A quick question.
I am writing a Document based app. When the app starts, it creates
an "Untitled" document. On the first "Open" request, a new window
is created to host the chosen document. All of this works fine.
However, one 'reviewer' pointed out that this is not how
"TextEdit" (for instance) behaves. Indeed, on the first "open"
request, the chosen document replaces the content of the "Untitled"
window.
So,... how should I go about replicating that behavior of textEdit?
Subclassing NSDocumentController?
Any pointer is most welcomed.
I think what TextEdit does is this:
- if it's launched without any documents, it creates a new empty
document as usual, but it also sets a flag;
- if the new file is edited, the flag is cleared;
- if an open request arrives, and the flag is still set, the empty
untitled document is close, the requested document is opened in its
place, and the flag is cleared.
Camillo
_______________________________________________
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