On Fri, Nov 28, 2008 at 5:50 AM, Rob Keniger <[EMAIL PROTECTED]> wrote:


>
> There's no public API to do this at present. You'd need to create a
> temporary file and use the "qlmanage -p /path/to/thefile" tool via NSTask.
>

I strongly discourage using qlmanage to display the Quick Look panel.
"qlmanage -p" is meant to debug plug-ins (as stated by the man page) and is
really not suited to provide a user interface. In fact, it will give you a
very poor user experience:

1) it executes the plug-in directly (and does not use quicklookd), it can't
protect itself from bad plug-in behavior.

2) it does not provide all Quick Look panel controls

3) since it's a simple terminal tool it does not integrate properly with a
calling application (does not get any key events, can't correctly zoom
in/out, etc.)

Using qlmanage that way will be even more discouraged in the future.

Of course, I also strongly discourage trying to use any private framework or
private API to work around that problem as you'll have 99% chance to see
your application broken in the next OS release.

The best you can hope is to wait for Apple to provide a public API (and you
are welcome filing a report to Apple).


>
> Of course, you'd need to write a QuickLook generator in order for the
> temporary file to be previewed correctly.
>
> If it were me, I'd just use a custom preview class as you have already
> done.
>

Exactly, an image view (IKImageView or NSImageView) + a HUD window is not
that hard to do.

-- 
Julien
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to