• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Named image for regular folder?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Named image for regular folder?


  • Subject: Re: Named image for regular folder?
  • From: "Mark Stultz" <email@hidden>
  • Date: Wed, 30 Jan 2008 12:04:51 -0600

And if your target is a previous iteration of OS X, a simple google yields
the following:
http://www.omnigroup.com/mailman/archive/macosx-dev/2002-January/034951.html

IconRef -> IconFamilyHandle -> NSData -> NSImage

That being said, I haven't tried this first hand, but it looks legit. No
idea about 64-bit on this; I guess though, if you are targetting 64-bit, you
are linking against 10.5 to begin with.

Mark Stultz

On Jan 30, 2008 10:55 AM, Matt Gough <email@hidden> wrote:

> On Leopard, you can now create an NSImage from a Carbon IconRef
>
> Icons.h defines a whole heap of additional icons that you can then get
> to. Something like this:
>
> IconRef carbonIcon;
>
> NSImage* folderImage = nil;
> OSStatus err = GetIconRef(kOnSystemDisk, kSystemIconsCreator,
> kGenericFolderIcon, &carbonIcon);
> if (!err)
>        {
>                folderImage = [[NSImage alloc] initWithIconRef:carbonIcon];
>                ReleaseIconRef(carbonIcon);
>        }
>
> Matt Gough
>
> On 30 Jan 2008, at 17:36, Ken Thomases wrote:
>
> > On Jan 30, 2008, at 10:11 AM, Jim Correia wrote:
> >
> >> Among the new named images available on Leopard, I see:
> >>
> >>      NSImageNameFolderBurnable
> >>      NSImageNameFolderSmart
> >>
> >> I don't see an image name for a regular, unadorned folder. Have I
> >> overlooked it?
> >
> > If you don't find anything better, the poor man's solution is -
> > [NSWorkspace iconForFile:].  If necessary, you can even name that
> > image with -[NSImage setName:] so you'll be able to refer to it from
> > nibs.  It won't appear in IB, but if you register the name early
> > enough in application startup, it will work at runtime.
> >
> > -Ken
> >
> > _______________________________________________
> >
> > 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

References: 
 >Named image for regular folder? (From: Jim Correia <email@hidden>)
 >Re: Named image for regular folder? (From: Ken Thomases <email@hidden>)
 >Re: Named image for regular folder? (From: Matt Gough <email@hidden>)

  • Prev by Date: Re: [Leopard] Creating shared NSOpenGLView, Core Animation backed
  • Next by Date: Re: Set Alpha for an NSImage
  • Previous by thread: Re: Named image for regular folder?
  • Next by thread: Re: Named image for regular folder?
  • Index(es):
    • Date
    • Thread