[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument close & NSApplication targetForAction

From: Fred Kiefer
Subject: Re: NSDocument close & NSApplication targetForAction
Date: Sat, 20 Sep 2003 18:55:57 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204

Matt Rice wrote:
bug when using NSDocument, the key window always
responds to close and so NSDocument close never gets
called.. and reopening a document would show the one
which you just "closed" rather than reading from
disk.. (tested with Ink..)

this patch moves the check for document based apps up
above the key window, and checks for them on
performClose for the windowmaker close button.

Sorry for replying so late, I was away for a week. Still I want to oppose this change as it does not stick with the documentation.

As for the first part of the patch it changes the search order for targets in a way that does not correspond to what the Cocoa documentation says. According to this the document is asked right after the windows delegate. If we cannot prove that this is handled differently in the actual Cocoa implementation we should keep the old way. Perhaps we have to change the way NSWindow implements close, as I can see the real problem that this patch tries to fix.

The second part is even worse, here closing the window and closing the document are mixed. This are two almost independend operations. A document may have multiple windows and may only close when the last one gets closed or sometimes not even then. Again I understand why this patch was intendend, but it tries to solve the problem the wrong way.

Once more, I am sorry for the late intervention and hope that together we can find a better way to solve this.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]