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: Fri, 05 Oct 2012 15:56:13 +0200
User-agent: Mozilla/5.0 (X11; FreeBSD i386; rv:15.0) Gecko/20120921 Firefox/15.0.1 SeaMonkey/2.12.1

Hi,

Wolfgang Lux wrote:
Riccardo Mottola wrote:
What I meant (and I guess I wasn't clear about that) is that you should not try 
to reimplement any functionality provided by NSDocument. NSDocument has already 
created the pop up with the document types at the time -prepareSavePanel: is 
called. So in your implementation of that method just ask the save panel for 
its current accessory view and add your own elements to that view (you may 
eventually need to resize the existing view for that). Or make the existing 
accessory view a subview of your own accessory view. If you want to dynamically 
change the save panel options depending on the document type currently chosen 
by the user, you can do so by overriding the (undocumented) NSDocument method 
-changeSaveType:. However, if you do so, be sure to call the super class 
implementation in your own method.

Aha, so you say I should just try to extend the existing view. That sounds the best way of course. I precisely want to that. Currently TIFF has no options, JPEG has a compression slider. Theoretically also TIFF has compression or not, but just boolean. If, in the future, I'll support something else, it might need for example Transparency for GIF and PNG...

Perhaps the best way would be to have N different small "options only" accessory views, like TIFFOptionsView, JPEGOptionsView and add them as a subview of the existing accessory view, but I don't know well how to mess with it.

is changeSaveType, undocumented, available on both Mac and GS? or is it some kind of extension? That would be the place probably where to add the view-swizzling code.

Riccardo



reply via email to

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