Re: How to find icon file path?
Re: How to find icon file path?
- Subject: Re: How to find icon file path?
- From: Chris Anderson <email@hidden>
- Date: Tue, 23 Jul 2002 18:59:22 -0700
I had a feeling this would be a tough issue to communicate properly. Let me
try again, in more detail.
I have a file, say, Foo.txt. NSFileManager iconForFile: Foo.txt gives back
an NSImage that that a the generic icon for text files in it. However, I
can find no method of NSImage (or NSFileManager) that tells the path to the
*icon* source from which the NSImage bitmaps were created. I'm assuming
this would look something like /System/Library/Whatever/Text.icns if I
could get it.
Stated another way, I'd like to be able to create the NSImage with the icon
bitmap in it myself, rather than have NSFileManager load the whole thing up
for me. My application wants to determine whether two files use the same
icon or not, and iconForFile: won't tell me that (short of comparing all
the bitmap pixels and wasting lots of spacetime, which I'd really rather
not have to do.)
So, the source for NSFileManager iconForFile: clearly has figure out where
to get its icon data from... what's the magic?
Thanks for bearing with me...
---Chris
At 06:06 PM 7/23/2002 -0600, you wrote:
Sorry, you lost me there somewhere... The path to the icon's file is the
same path that you pass to [NSFileManager iconForFile:]. Isn't that what
you're looking for? If what you are saying is that you have an NSImage
that is the icon, you cannot figure out the path that it belongs to, at
least not using included APIs, and probably not with anything else,
either, as there is probably going to be more than one file using that icon.
Clark
On Tuesday, July 23, 2002, at 05:12 PM, Chris Anderson wrote:
Given some arbitrary file, how does one retrieve the path to its
corresponding icon file?
I know about NSFileManager iconForFile:, but it doesn't quite do what I
want, because I require a path to the icon file itself rather than the
NSImage contained in it.
_______________________________________________
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.
_______________________________________________
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.