Hi Wolfgang,
Wolfgang Lux wrote:
Hi Riccardo,
I think you are on a completely wrong track here. If you want to add a JPEG
file type to PRICE, you should declare that in the NSTypes (or
CFBundleDocumentTypes) section of the Info.plist file as a separate type, but
using the same NSDocumentClass as for TIFF files. Then, the NSDocument
framework will automatically handle the file type and file extension for you
and you shouldn't override saveDocumentAs: (it will not work in the way you'd
expect on OS X anyway thanks to document modal sheets anyway).
To add options for the JPEG type you must add an accessory view to the save
panel in -prepareSavePanel:, as Fred and Nikolaus suggested. Make sure you save
the values selected by the user in attributes of your document class, so you
have them available in -dataRepresentationOfType:
Exactly, I added an accessory view, however as far as I understand, the
document types are now my burden. I do not want to override
saveDocumentAs anymore, at least not for this need. I can read back what
was selected with fileTypeFromLastRunSavePanel, however in the
"standard" view which these the type selection generated by the
NSDocumentClass are handled automatically. In the standard panel,
selection them does change the extension of the file directly (and
perhaps does other things too and I want to emulate this).
Your suggestion would be then to populate the popup dynamically by the
supported NSDocumentClass types? That would be a further plus that adds
some burden, since some have certain options other others, but could be
cool.
Riccardo
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep