Re: NSSavePanel: Saving with file extension
Re: NSSavePanel: Saving with file extension
- Subject: Re: NSSavePanel: Saving with file extension
- From: Dirk Stoop <email@hidden>
- Date: Mon, 26 May 2008 16:46:57 +0200
Hi Vince,
Take a look at the 'setRequiredFileType:' instance method in the
NSSavePanel Class Reference.
http://tinyurl.com/467rzq
The string you supply as an argument is the extension the file will
get (without the period).
To hook this up you can create an instance method 'setFileType:' in
your controller class and set that as the target/action for the
NSPopupButton you use in the accessoryView, in your 'setFileType:'
implementation you can get the 'titleOfSelectedItem' or
'indexOfSelectedItem' from the NSPopupButton (the sender of te action)
to determine what the argument of the 'setRequiredFileType:' call to
your export panel should be.
Hope this answers your question,
Dirk
On May 26, 2008, at 3:42 PM, vince wrote:
I have an accessory view associated with a custom save panel. The
accessory
view lists various image formats [jpeg, gif, etc]. Currently after
saving,
the files show up as unsupported due the lack of an appended file
extension. Manually inserting the file extension in the save panel
prior to
saving ... or editing the saved file by adding the extension after
the fact
fixes the problem.
How can I set things up in the savePanel so that it saves out files
with the
proper file extension based on the selection in the accessory view/
thanks.
_______________________________________________
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