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



On 2007-06-11, at 08:04:15, Yaron Tadmor wrote:

Well, after looking into it I see the way I need to go is this:
1)       Create my custom icon for the package.
2)       Create a "icon\r" file in the package.
3)       Add my image as a resource.

In the sample application that I could find, this is done by creating a PicHandle and converting it into an icon. However, the docs say that the picture functions are deprecated in 10.4.
So what do I use instead to convert my image into an icon??? I'm holding the image in a buffer suitable to be wrapped by a GWorld, but what do I do with it next?

The following is a slightly different approach. I'm presuming the document bundle is already created and an image recognized by the system is somewhere in it:


1. Do a system( "sips -i '/path/to/image.tif'" );
2. Copy the handle to the custom icon resource in the image.tif to the "Icon\r" resource fork in the package folder. [1]
3. Set the invisible flag on "Icon\r".
4. Set the custom icon flag on the package folder.


[1] Delete the custom icon resource in the image.tif if desired.


No deprecated functions in 10.4.

Philip Aker
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
References: 
 >RE: File/Folder icons - normal and custom (From: "Yaron Tadmor" <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.