On 01/27/09 09:49, "Christiaan Hofman" <[email protected]> wrote:
>
> On 27 Jan 2009, at 5:46 PM, Maxwell, Adam R wrote:
>
>>
>>
>>
>> On 01/27/09 02:54, "Christiaan Hofman" <[email protected]> wrote:
>>
>>>
>>> On 27 Jan 2009, at 2:05 AM, Maxwell, Adam R wrote:
>>>
>>>> On 01/26/09 16:00, "Christiaan Hofman" <[email protected]> wrote:
>>>>
>>>>> Yes, but that's all about the window title, not the represented
>>>>> file.
>>>>> I can only find one vague reference to the represented file, and as
>>>>> soon as they get specific they forget to mention it.
>>>>
>>>> Well, for my original comment I was actually going off of the API
>>>> docs,
>>>> which say this:
>>>>
>>>> "synchronizeWindowTitleWithDocumentName
>>>> Synchronizes the displayed window title and the represented filename
>>>> with
>>>> the information in the associated document."
>>>>
>>>> I think that's pretty clear in referring to "the represented
>>>> filename."
>>>> Indeed, if you set a breakpoint on -[NSWindow setRepresentedURL:],
>>>> it's
>>>> called from -[NSWindowController
>>>> synchronizeWindowTitleWithDocumentName].
>>>>
>>>
>>> And it's the one I was referring to. When it gets explicit, it
>>> completely misses it.
>>
>> Misses what? It tells you in the summary that it's going to update
>> the
>> window title and represented filename, then in the description it
>> tells
>> which document methods are called.
>>
>>> And the method name is absolutely anti-
>>> suggestive.
>>
>> I do agree on that point.
>>
>>> Moreover, my biggest point: how do I know this is THE way
>>> it happens, in other words, how do I know that overriding this method
>>> will not bite me somewhere else?
>>
>> The AppKit release notes link I posted says that it's called
>> whenever the
>> document has changed such that window title needs updating. Since
>> that's
>> dependent on the filename (by default), it must be called whenever the
>> filename changes as well.
>>
>
> The only thing all this documentation tells me is that when the /
> displayName/ changes, the synchronizeWindowTitleWithDocumentname
> method is called, because that's what determines the title by default.
> However, it is very well possible that the /filename/ changes without
> the /displayName/ changing. Note that when the displayName changes,
> the file path also changes, so it would make sense to change the proxy
> icon at this time. Given this documentation, there is nothing telling
> me that there's not also a private method that updates the proxy icon
> as a result of a change in the /filename/. I don't think it's the
> case, but I also don't know it's not, based on the documentation.
Well, the header says that it's called when the fileName of the document
changes, and if there's a fileName it's always set as the represented file.
- (void)synchronizeWindowTitleWithDocumentName;
// This method is invoked automatically whenever the controller's
document has changed that would affect the window title. (For instance,
when the fileName of the document changes, or when the controller gets a new
document.) This method uses the -displayName method of NSDocument to find
out the display name. It then passes the display name to
-windowTitleForDocumentDisplayName: to give it a chance to change it.
Finally, if the document has a -fileName and the display name is the same as
the -fileName's last component, it actually sets the title from the
-fileName instead of the display name. Otherwise it sets the title from the
display name. If there is a -fileName, that file is always set as the
window's represented file The window title is left alone if the controller
has no document. This method can be overridden if you need to do something
else.
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Bibdesk-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-develop