Retrieve OS icon for file type

I believe this must be OS specific, but is there a way on mac to retrieve the
image/icon for a file type that the OS uses in finder(file explorer)? Even just
a starting point would be fantastic. I can't seem to bring up anything
searching. Thanks!

Take a look at wx.MimeTypesManager. It looks like enumerating the known types isn't working very well, at least in my current 2.9.3 Cocoa version, but looking up types by extension seems to be working fine.

···

On 12/16/11 7:18 AM, Paul wrote:

I believe this must be OS specific, but is there a way on mac to retrieve the
image/icon for a file type that the OS uses in finder(file explorer)? Even just
a starting point would be fantastic. I can't seem to bring up anything
searching. Thanks!

--
Robin Dunn
Software Craftsman

Robin Dunn <robin <at> alldunn.com> writes:

> I believe this must be OS specific, but is there a way on mac to retrieve the
> image/icon for a file type that the OS uses in finder(file explorer)? Even

just

> a starting point would be fantastic. I can't seem to bring up anything
> searching. Thanks!
>

Take a look at wx.MimeTypesManager. It looks like enumerating the known
types isn't working very well, at least in my current 2.9.3 Cocoa
version, but looking up types by extension seems to be working fine.

This looks like it could be exactly what I'm after, however using
GetFileTypeFromExtension with different extensions I'm getting 'Error: Can't
load image from file' on everything I've tried when calling GetIcon(). The path
to the image looks to be correct so it does look promising. Any idea what might
be the problem?

···

On 12/16/11 7:18 AM, Paul wrote:

Which version of wxPython are you using? Does the sample in the demo have the same problem?

···

On 12/16/11 10:24 AM, Paul wrote:

Robin Dunn<robin<at> alldunn.com> writes:

On 12/16/11 7:18 AM, Paul wrote:

I believe this must be OS specific, but is there a way on mac to retrieve the
image/icon for a file type that the OS uses in finder(file explorer)? Even

just

a starting point would be fantastic. I can't seem to bring up anything
searching. Thanks!

Take a look at wx.MimeTypesManager. It looks like enumerating the known
types isn't working very well, at least in my current 2.9.3 Cocoa
version, but looking up types by extension seems to be working fine.

This looks like it could be exactly what I'm after, however using
GetFileTypeFromExtension with different extensions I'm getting 'Error: Can't
load image from file' on everything I've tried when calling GetIcon(). The path
to the image looks to be correct so it does look promising. Any idea what might
be the problem?

--
Robin Dunn
Software Craftsman

Which version of wxPython are you using? Does the sample in the demo
have the same problem?

I'm using 2.8.12.1, going down the mime types in mac I get no icons for any, and
in windows I get around half. Should I switch to 2.9?

It's worth a try, although as I mentioned there is something wrong with the function that enumerates all known types but, retrieving icons for specified file extensions does seem to be working in my current workspace.

···

On 12/20/11 2:56 AM, Paul wrote:

Which version of wxPython are you using? Does the sample in the demo
have the same problem?

I'm using 2.8.12.1, going down the mime types in mac I get no icons for any, and
in windows I get around half. Should I switch to 2.9?

--
Robin Dunn
Software Craftsman

It's worth a try, although as I mentioned there is something wrong with
the function that enumerates all known types but, retrieving icons for
specified file extensions does seem to be working in my current workspace.

I'm running 2.9 now and I am getting some icons working. I've just tried running
the demo to see which are working and which are not but I get a traceback written
over the gui. I can't read it properly because its written over the demo, but I
can see it's a PyAssertionError

Yes, I saw that too and have adjusted the demo to avoid the exception. It has to do with enumerating the known file types like I mentioned before.

···

On 12/22/11 8:06 AM, Paul wrote:

It's worth a try, although as I mentioned there is something wrong with
the function that enumerates all known types but, retrieving icons for
specified file extensions does seem to be working in my current workspace.

I'm running 2.9 now and I am getting some icons working. I've just tried running
the demo to see which are working and which are not but I get a traceback written
over the gui. I can't read it properly because its written over the demo, but I
can see it's a PyAssertionError

--
Robin Dunn
Software Craftsman