Re: finder eject images
Re: finder eject images
- Subject: Re: finder eject images
- From: Matt Gough <email@hidden>
- Date: Wed, 06 Jul 2011 09:07:50 +0100
> As everyone else has been saying, NSWorkspace image for
> type/file APIs and +[NSImage imageNamed:] are the API, and if it isn't
> there, you can file a bug but should use your own artwork. (As it says in
> the NSImage header.)
Even if it isn't available via imageNamed, you might still be able to find it by using IconServices.
That contains a lot more icons (lots of which are long obsolete)
See IconsCore.h. I'm not sure how you'd go about converting an IconRef to an NSImage, but maybe you don't need to. You can just draw them directly using PlotIconRefInContext.
Matt
On 6 Jul 2011, at 03:31:57, Ken Ferry wrote:
> On Tue, Jul 5, 2011 at 7:34 AM, Patrick Robertson <
> email@hidden> wrote:
>
>>> This is extremely fragile. You have no guarantee this image will continue
>> to exist, that it will always be in ICNS format, or that the CoreTypes
>> bundle will even continue to exist.
>>
>> True, but this method has been working for our app for 8 years now, no
>> problems :)
>> If you have any better suggestions, feel free to let me know!
>>
>
> You know, people really like to use this excuse. And then when it stops
> working, they're like "it's been working for so long!"
>
> This is not part of the API, and it is not supported. Not every piece of
> artwork the OS uses can be considered supported API - we'd never be able to
> change anything. As everyone else has been saying, NSWorkspace image for
> type/file APIs and +[NSImage imageNamed:] are the API, and if it isn't
> there, you can file a bug but should use your own artwork. (As it says in
> the NSImage header.)
>
> Ken Ferry
> Cocoa Frameworks
>
>
>
>
>>
>> For those hoping to use the CoreTypes.bundle ICNS, I have not seen any of
>> them disappear or change name in over 8 years with OS updates. No changes
>> is
>> Lion either as far as I can tell.
>>
>> On 5 July 2011 15:20, Kyle Sluder <email@hidden> wrote:
>>
>>> On Jul 5, 2011, at 5:20 AM, Patrick Robertson <
>> email@hidden>
>>> wrote:
>>>
>>>> I wasn't suggesting that be done. Here's the code I use in my apps:
>>>>
>>>> - (NSImage *)sysIconNamed:(NSString *)name {
>>>>
>>>> NSString *path = [[NSBundle bundleWithPath:
>>>> @"/System/Library/CoreServices/CoreTypes.bundle"] pathForResource:name
>>>> ofType:@"icns"];
>>>
>>> This is extremely fragile. You have no guarantee this image will continue
>>> to exist, that it will always be in ICNS format, or that the CoreTypes
>>> bundle will even continue to exist.
>>>
>>> --Kyle Sluder
>> _______________________________________________
>>
>> 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
>>
> _______________________________________________
>
> 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
_______________________________________________
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