Re: Custom preview for NSOpenPanel
Re: Custom preview for NSOpenPanel
- Subject: Re: Custom preview for NSOpenPanel
- From: "Sean McBride" <email@hidden>
- Date: Mon, 4 Jun 2007 13:21:04 -0400
- Organization: Rogue Research
On 2007-06-04 20:19, Ron Fleckner said:
>> My application uses a non standard file format. I would like to
>> provide
>> preview of such file type in the NSOpenPanel window. Is there a way
>> to do it
>> in Cocoa?
>
>on Panther and higher, you can get the path to the selected file in
>the open panel without needing the user to click 'Open'. You can
>have a NSView subclass to add to the open panel via setAccessoryView:
>(from NSOpenPanel's super class, NSSavePanel). Whatever you have in
>your view subclass will appear as a pane inside a box at the bottom
>of the open panel. So you just need to set up your view subclass to
>be able to handle displaying a preview of your 'non standard file',
>and Bob's your uncle, as they say.
But then your preview would be in your own view and not in the usual
place that previews are shown for files that the OS recognises. The
answer to the OP's question is 'no', not with NSOpenPanel :(
Instead, you can use Carbon's Navigation Services, and write a 'Preview
Callback'. Also, file a bug asking for NSOpenPanel to also have this
ability. See:
<http://developer.apple.com/documentation/Carbon/Conceptual/
ProvidingNavigationDialogs/nsx_tasks/chapter_3_section_6.html>
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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