gnustep-dev
[Top][All Lists]
Advanced

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

Re: Methods +readable/writableTypes


From: Fred Kiefer
Subject: Re: Methods +readable/writableTypes
Date: Sat, 15 Feb 2014 19:43:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

On 13.02.2014 06:00, Germán Arias wrote:
> On 2014-02-12 14:32:26 -0600 Fred Kiefer <address@hidden> wrote: 
> [...]
>> 
>> Now I am completely confused. From inspecting the code I would say
>> that this method must get called.
>> 
>> The whole process of saving a file should start from 
>> -_runSavePanelForSaveOperation: in NSDocument. This calls 
>> -runModalSavePanel:withAccessoryView: and there we either call 
>> -runModalForDirectory:file: or -runModal on the save panel. The
>> later method calls the former, which means we must end up there. I
>> just tested that with the standard NSSavePanel and it worked as 
>> expected. (Apart from freezing my machine as I had a breakpoint in
>> a method called from a menu action. I really need to remove the 
>> _captureMouse: calls you placed in NSMenuView years ago :-)
>> 
>> The only method that doesn't end there is
>> -beginSheetForDirectory:... in WinNSSavePanel, maybe you are taking
>> that code path? In that case you should move your breakpoint to 
>> -runModalForDirectory:file:types:relativeToWindow: Anyway, the
>> filetypes you get passed into this methods should be the result of
>> -allowedFileTypes. You really should use that value.
> 
> Yes, my breakpoint was wrong. But using fileTypes don't solve the
> problem. If you see at line 1198 at NSDocument.m, are passed the
> extensions for the document type, not all extensions. I think this is
> correct, because we are saving an specific type of document. The
> accessory view provides a way to change the type, but this don't
> exist at Windows. See at line 1215 in NSSavePanel.m, we use the first
> extension in _allowedFileTypes. So, if we pass all extensions (from
> all types), we can't be sure that first extension correspond to the
> current document.

Sorry, only now do I think I actually understand this issue. In the
WinNSSavePanel you want to replace the accessory view with values for
the lpstrFilter. But in the method on WinNSSavePanel you no longer have
access to the NSDocument or the save operation and need to get these
values in some other way.
Now would it be an option to access the _spa_button of the accessory
view from the WinNSSavePanel? We could give that button a specific tag
and your code would request the view with that tag? Not very beautiful
code, but an option if your attempts to solve it otherwise fail.

In one of your mail you wrote: "However, if I remember correctly, NSLog
don't works in a theme (almost on Windows)."
As far as I remember the output from NSLog ends up in the Event viewer
of Windows. And if you run with a debugger it should be outputted there.

Fred



reply via email to

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