[wxPython-users] How do I find/display the icons associated with
file type
Rune Devik
rune.devik at gmail.com
Wed Sep 5 01:35:53 PDT 2007
Hi Geoff
I have implemented something that kinda works for windows since the
MimeTypesManager does not give you all the functionality you need. At least
it didn't do that a year ago. This code will:
1) Extract icons from exe files if they have any
2) Try to figure out the mime type and use the associated image if any
3) return the icon of a com/exe file as default if we're not able to resolve
The code in question can be found at sourceForge:
http://launcher.cvs.sourceforge.net/launcher/launcher/src/IconExtractor.py?=
revision=3D1.5&view=3Dmarkup
http://launcher.cvs.sourceforge.net/launcher/launcher/src/GuiUtils.py?revis=
ion=3D1.4&view=3Dmarkup
Hope this gives you an idea. If you find a better solution please let me
know :)
Regards,
-- =
Rune Devik
http://www.garageinnovation.org
On 9/3/07, Geoff Skerrett <Geoff at teammsa.com> wrote:
>
>
> > -----Original Message-----
> > From: Werner F. Bruhin [mailto:werner.bruhin at free.fr]
> > Sent: Sunday, September 02, 2007 2:16 PM
> > To: wxPython-users at lists.wxwidgets.org
> > Subject: Re: [wxPython-users] How do I find/display the icons
> > associated with file type
> >
> > Geoff,
> >
> > Geoff Skerrett wrote:
> > > I am hoping someone can point me in the right direction.
> > >
> > > We have an application where users can select files from
> > directories.
> > > The resulting files are displayed in a CustomTree control.
> > >
> > > We would like the to display the associated icon for the
> > file type --
> > > so if it is a PDF file, then the icon for Acrobat Reader would
> > > display, if the file is an Excel spreadsheet, the Excel
> > icon display, etc.
> > >
> > > Does anyone do something similiar ?
> > > If not, any suggestions would be appreciated.
> > > - currently all files use a generic icon in the tree
> > control, so this
> > > is a "usability" feature we would like to add.
> > Have a look in the archive of this list, around the middle of
> > June there was a thread on this "[wxPython-users] Fetch
> > file's associated icon"
> >
> > Werner
> >
>
> Thanks Werner.
> You tip wasn't exactly correct, but it did lead me to a post by Robin
> suggesting the use of wx.MimeTypesManager and then the corresponding
> wx.FileTypes.
>
> Thanks for getting me started.
>
> Geoff.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200709=
05/1c197393/attachment.htm
More information about the wxpython-users
mailing list