Re: NSSavePanel and file formats
Re: NSSavePanel and file formats
- Subject: Re: NSSavePanel and file formats
- From: Graham Cox <email@hidden>
- Date: Mon, 20 Apr 2009 17:16:41 +1000
On 18/04/2009, at 7:56 AM, Quincey Morris wrote:
I notice that the current HIG recommends the use of a file format
popup in the Save dialog, when an application supports multiple
formats:
http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGMenus/XHIGMenus.html#/
/apple_ref/doc/uid/TP30000356-TPXREF105
and the picture of the Save dialog seems to suggest that the popup
is to be implemented in an accessory view:
http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGWindows/XHIGWindows.html#/
/apple_ref/doc/uid/20000961-SW47
It seems to me that *each* of the formats in the popup is going to
have its *own* list of valid file extensions, so that changing the
selected item in the popup should make a corresponding change to
NSSavePanel's allowedFileTypes.
I can sort of see my way to doing that by subclassing a
NSViewController that owns the accessory view, and making the view
controller responsible for calling allowedFileTypes when the popup
selection changes, but I'm wondering if I'm overlooking a more
direct solution.
I'm also wondering if changing allowedFileTypes while the Save
dialog is displayed will actually work. (Will it replace the
extension of whatever is currently in the file name text field?)
Comments, anyone?
The save dialog shows the format pop-up automatically if you declare
in your info.pList that you export multiple types. Presumably it also
takes care of everything else too - you just need to set up the pList
and respond to the type passed to your document's -daatOfType:error:
method which will depend on what the user chose.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden