Re: How to get an undeprecated FSRef
Re: How to get an undeprecated FSRef
- Subject: Re: How to get an undeprecated FSRef
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Tue, 01 Nov 2016 15:20:28 +0700
> On 1 Nov 2016, at 14:44, Ken Thomases <email@hidden> wrote:
>
> On Nov 1, 2016, at 2:08 AM, Gerriet M. Denkmann <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden