Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Cocoa Custom Icon Creation

Cocoa Custom Icon Creation
Thread Tools
Junior Member
Join Date: Nov 2001
Location: Indiana
Status: Offline
Reply With Quote
Jan 5, 2002, 07:13 AM
 
So I have this beautiful NSImage and a NSFileWrapper. I had assumed that NSFileWrapper's setIcon: method set the file icon which is viewed in the Finder. Apon closer inspection, this proved to be incorrect.

So, my question is -- how do I change a file's icon in cocoa? I thought for sure there would be a nice cocoa method for it, like there is for changing type/creator codes, but I could not find it anywhere.

Any ideas?

---
sig broke til MWSF
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Jan 6, 2002, 01:56 PM
 
Nope. Gotta use Carbon. See Icons.h for how to create an 'icns' data structure (or look in the archives of the macosx-dev mailing list for an ObjC class someone wrote for the same purpose). Then use the Resource Manager to save it in the proper place to be the file's custom icon (see Inside Mac for that).
Rick Roe
icons.cx | weblog
     
Junior Member
Join Date: Nov 2001
Location: Indiana
Status: Offline
Reply With Quote
Jan 6, 2002, 06:23 PM
 
Thanks Rickster. I'll have to spend a few days figuring all this out.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:40 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2