• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting thumbnail of document to appear?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting thumbnail of document to appear?


  • Subject: Re: Getting thumbnail of document to appear?
  • From: Brent Gulanowski <email@hidden>
  • Date: Thu, 7 Nov 2002 10:53:01 -0500

On Thursday, November 7, 2002, at 04:08 AM, Chris Ridd wrote:

On 7/11/02 5:41 am, Alex Rice <email@hidden> wrote:

On Wednesday, November 6, 2002, at 05:00 PM, Dave Mattson wrote:

Good evening:

Does anyone know what I need to provide to get my application to
support and
present thumb nail images instead of just a standard file icon.
cocoa-OSX of
course. Where do those come from anyway?

My question is just where I can find some documentation.

I have gone back through all the documentation and can't seem to find
any
clues.


NSImage *theFileIcon = [[NSWorkspace sharedWorkspace] iconForFile:
@"/path/to/file"];
[myImageViewOutlet setImage: theFileIcon];

Oh wait-- I just reread your message and I'm not sure this is what you
are after. The method above will show the appropriate icon for whatever
file type it is, but I don't think it "previews" the file. However some
file types show a preview. I don't know maybe I shouldn't be answering
:-)

I think Dave's talking about giving custom icons to each file. IIRC that's
done by adding a resource fork to the file and stuffing the icon in that.

I personally would like to know how to tell the finder that a particular file type should be preview-able. This is also what I think the OP was talking about. As in with .pdf or .txt, which don't have a "custom" icon. You can make a custom icon by cutting and pasting, and no, it doesn't use the resource fork, it uses a hidden .icns file -- although I guess custom icons in resource forks are still supported in the finder. There are many text-based file types, for example, that the Finder could show a preview of, but because it doesn't "know" that these are text-based, it doesn't try. I for one would like if the Finder previewed C, C++ and Java files. Unfortunately this doesn't do anything for files that start with copyright notices, but I'm sure that there are other examples.

In any case, I think it's a matter of whether either the Finder or Quicktime understand the file type, otherwise, no preview. Or is there a suggestion here that the Finder will ask owner apps for previews of files? Well, how could that work if your application wasn't running? In which case, you'd just go with Chris's suggestion and create your own custom icon.

Note: I'm sure we don't want to use this discussion to start a rant-a-thon about metadata all over again, tempting though it is :-).

--
Brent Gulanowski email@hidden

http://inkubator.idevgames.com/
Working together to make great software.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Getting thumbnail of document to appear?
      • From: Chris Ridd <email@hidden>
References: 
 >Re: Getting thumbnail of document to appear? (From: Chris Ridd <email@hidden>)

  • Prev by Date: Re: Getting thumbnail of document to appear?
  • Next by Date: Re: Window Placement
  • Previous by thread: Re: Getting thumbnail of document to appear?
  • Next by thread: Re: Getting thumbnail of document to appear?
  • Index(es):
    • Date
    • Thread