> On 1 Nov 2016, at 14:44, Ken Thomases <k...@codeweavers.com> wrote:
> 
> On Nov 1, 2016, at 2:08 AM, Gerriet M. Denkmann <gerri...@icloud.com> wrote:
>> 
>> I am using ReadIconFromFSRef (not deprecated), which needs an FSRef.
>> 
>> How to convert a path into an FSRef without deprecation warnings in macOS 12 
>> ?
> 
> I doubt you'll find anything.  You should switch to using NSImage and 
> -initWithContentsOfURL: (or -initWithContentsOfFile:).
> 
> Regards,
> Ken

What I really want to do: Create custom icons for folders programmatically.

I have some old code (still working, but very much deprecated) like:

IconFamilyHandle hIconFamily;
ReadIconFromFSRef( &fsRef_of_icns_file, &hIconFamily ); // this is the only 
non-deprecated function

ResFileRefNum file = FSOpenResFile( &fsRef_of_new_Icon, fsRdWrPerm );
AddResource( (Handle)hIconFamily, kIconFamilyType, kCustomIconResource, name);
CloseResFile( file );

+ some FSGetCatalogInfo, FSSetCatalogInfo.

finally:  
FNNotify( &targetFolderFSRef, kFNDirectoryModifiedMessage, kNilOptions );

and I would like to convert this code into some non-deprecated form.


Kind regards,

Gerriet.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to