Re: Custom preview for NSOpenPanel
Re: Custom preview for NSOpenPanel
- Subject: Re: Custom preview for NSOpenPanel
- From: Ron Fleckner <email@hidden>
- Date: Mon, 4 Jun 2007 20:19:12 +1000
From: Anton Spivak <email@hidden>
Hello!
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?
Thanks,
Anton.
Hello Anton,
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.
Ron
_______________________________________________
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