Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: File/Folder icons - normal and custom



Thanx, That definitely helps. Since my docs are packages, I'll go with creating the "Icon\r" file.

 


From: John Stiles [mailto:email@hidden]
Sent: Sunday, June 10, 2007 5:18 PM
To: Yaron Tadmor
Cc: Eric Schlegel; carbon-dev
Subject: Re: File/Folder icons - normal and custom

 

If you are interested in provided bundled documents, I can probably provide some insight by way of example.
Try opening Safari and starting the download of a large file. Observe that in your download folder, the ".download" file has a steadily increasing progress bar in its icon.
This file is actually a document bundle. Safari is repeatedly updating the "Icon\r" file inside the bundle with a new icon as the download bar gets larger.
You could use this approach to put custom icons on your documents as well.
Alternatively, if you don't like document bundles, you can add a 'icns' resource to your file with ID -16455.
These are basically the techniques shown in SetCustomIcon, so I guess to answer your question, I guess there isn't a simpler way :)

Yaron Tadmor wrote:

Thanx Eric,
 
I actually saw this sample and still had 2 questions:
1) Is this the easiest way to do this? The code there seems quite long for such a simple task.
2) Can you perhaps explain a bit the concept behind these custom icons? What does finder look for in files and in folders? Perhaps, I can simplify the code to suite my needs.
 
Thanx
Yaron
 
 
 
  
-----Original Message-----
From: Eric Schlegel [mailto:email@hidden]
Sent: Sunday, June 10, 2007 5:00 PM
To: Yaron Tadmor
Cc: Asterio Rodríguez; carbon-dev
Subject: Re: File/Folder icons - normal and custom
 
 
On Jun 10, 2007, at 8:42 AM, Yaron Tadmor wrote:
 
    
Thanx for the tip, but the guidelines have little to do with my
question. I already know what I want the icon to look like, and I
want a custom one per each and every document (since the icon is a
preview). My question was mainly technical - how do I easily achieve
setting a custom icon to a specific file/folder/package?
      
Take a look at this sample code:
<http://developer.apple.com/samplecode/SetCustomIcon/index.html
 >
 
Quoting from the comments in main.c:
 
A file with a custom icon must contain a resource ( 'icns', -16455 )
and have its kHasCustomIcon bit set.
A folder with a custom icon must contain a file named "\pIcon\r"
within it with a resource ( 'icns', -16455 ) and have the folders
kHasCustomIcon bit set.
 
    
My x-plat question, was to see if there's a way to use some kind of
x-plat format for the icon, such as tiff or jpg.
      
No, there is not.
 
-eric
 
    
 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
 
This email sent to email@hidden
  
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.