Re: Icon question
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