• 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: Icon question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Icon question


  • Subject: Re: Icon question
  • From: Michael McCracken <email@hidden>
  • Date: Tue, 26 Jul 2005 16:57:16 -0700

Since iconforfiletype lets you send in strings that encode hfs file
types you get from this:
NSString *NSFileTypeForHFSTypeCode(OSType hfsFileTypeCode)

maybe you could find out what the hfsfiletype of directories is and do that...

But I think it'd be simpler to pick a directory you can guarantee will
be there, like /,
and just get the icon for that specific file:

iconForFile:@"/"

-mike


On 7/26/05, John Stiles <email@hidden> wrote:
> OK, now here's a stumper:
> How do I get the icon for a plain old folder?
>
>
> On Jul 26, 2005, at 4:26 PM, John Stiles wrote:
>
> > Wow, two responses in under ten minutes! And both are useful!
> > I love Cocoa-Dev :) :) :)
> >
> >
> > On Jul 26, 2005, at 4:26 PM, Vince DeMarco wrote:
> >
> >
> >>
> >> On Jul 26, 2005, at 4:12 PM, John Stiles wrote:
> >>
> >>
> >>
> >>> Given a particular file extension (TXT, RTF, JPG, etc), how can I
> >>> get an NSImage containing the default 16x16 icon that represents
> >>> that file type?
> >>>
> >>> I'm sure it's possible, and I can think of some hokey ways to do
> >>> it, but I don't know the official technique.
> >>>
> >>> Thanks :)
> >>> _______________________________________________
> >>> Do not post admin requests to the list. They will be ignored.
> >>> Cocoa-dev mailing list      (email@hidden)
> >>> Help/Unsubscribe/Update your Subscription:
> >>>
> >>> This email sent to email@hidden
> >>>
> >>>
> >>>
> >>
> >>
> >> Look at NSWorkspace.h
> >>
> >> - (NSImage *)iconForFile:(NSString *)fullPath;
> >> - (NSImage *)iconForFiles:(NSArray *)fullPaths;
> >> - (NSImage *)iconForFileType:(NSString *)fileType;
> >>
> >>
> >>
> >
> > _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Cocoa-dev mailing list      (email@hidden)
> > Help/Unsubscribe/Update your Subscription:
> > 40blizzard.com
> >
> > This email sent to email@hidden
> >
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>


--
Michael McCracken
UCSD CSE PhD Candidate
research: http://www.cse.ucsd.edu/~mmccrack/
misc: http://michael-mccracken.net/blog/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Icon question (From: John Stiles <email@hidden>)
 >Re: Icon question (From: Vince DeMarco <email@hidden>)
 >Re: Icon question (From: John Stiles <email@hidden>)
 >Re: Icon question (From: John Stiles <email@hidden>)

  • Prev by Date: Re: NSDocument newbie
  • Next by Date: Re: NSDocument newbie
  • Previous by thread: Re: Icon question
  • Next by thread: Re: Icon question
  • Index(es):
    • Date
    • Thread