discuss-gnustep
[Top][All Lists]
Advanced

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

Re: custom options during save in a document app


From: Riccardo Mottola
Subject: Re: custom options during save in a document app
Date: Sun, 07 Oct 2012 22:52:53 +0200
User-agent: GNUMail (Version 1.2.0)

Hi,

On 2012-10-07 14:02:37 +0200 Wolfgang Lux <wolfgang.lux@gmail.com> wrote:


You don't need the pop up button. I told you above that the pop up button is set to the current type of the document and this is what NSDocument's -fileType method returns!
yes, got that, I use that on startup to know which type is presented and I shuffeld the code to initialize the status each time, easy. Works like a charme now. (on the first run, that is)

Which doesn't surprise me much, as the save panel on OS X on the second call should be different as well :-) Contrary to what the documentation says, you get a new panel for each call of NSSavePanel -savePanel. But then, this shouldn't matter much for your code.
exactly, I don't care if I get each time a new one. I retain my original view coming from the NIB file.

What coiuld be is that the the panel's view which I add to my own view gets released and that this causes toruble? I dont' see why, I add one next time. Perhaps it should bre cleanly "removed" from th superview instead of just being released? that would become tricky. I in fact get this exception now, on Mac:

2012-10-07 19:17:12.077 PRICE[1495] *** -[NSCFString setEnabled:]: selector not recognized [self = 0x4ffbe0] 2012-10-07 19:17:12.082 PRICE[1495] *** -[NSCFString setEnabled:]: selector not recognized [self = 0x4ffbe0] this is bgous, this is actually, according to gdb, there the compression slider gets enabled! not a string.

Another run got me:
2012-10-07 22:15:15.282 PRICE[1561] *** -[_NSViewAuxiliary setEnabled:]: selector not recognized [self = 0x4d1640] 2012-10-07 22:15:15.307 PRICE[1561] *** -[_NSViewAuxiliary setEnabled:]: selector not recognized [self = 0x4d1640]

This shows that it is "random stuff", just some kind of memory corruption I guess,

On GNUstep I ca't get anything to work at the moment, I expect I need some slight different reparent code, because the accessory view is not a Box, however right now I get "null" for the original content view. Does it work for you?

Just checked and it indeed doesn't work on GNUstep. Turns out this is because GNUstep is still using a long deprecated API (-runModalSavePanel:withAccessoryView:) to present the save panel. However, this gives you a different option to modify the accessory: Override that NSDocument method and change the accessoryView passed to that method before calling the super class implementation.

Why does it matter? the calling sequence is different? I see my methods called, but the values are still null. So th calls look compatible, but something is perhaps not initialised?

I tried overriding it in MyDocument.m and it never gets called :(

Riccardo




reply via email to

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