wxPyAtol

Francesco scrutinizer at gmx.at
Fri Feb 6 11:54:23 EST 2004


On Mon, 2 Feb 2004 09:48:39 -0000, Tim Golden
<tim.golden at viacom-outdoor.co.uk> wrote:

> [... snip announcement of wxPyAtol ...]
>


Hello Tim,

thank you for your answer,

> >
> >Maybe someone could help me and give me some pointers:
> >In the source, it is marked with todo.
> >for example to retrieve the imagelist from Windows fileextensions
> >self.m_hImageList = windll.shell32.SHGetFileInfo('.txt',
> >win32file.FILE_ATTRIBUTE_NORMAL, byref(shfileinfo),
> >sizeof(shfileinfo), dwFlags)
> >How can I get this in python?
>
> I'm a little confused. I've run the app, but I can't see
> how to invoke the code which uses the CImageList class.

I didn't use it, because i coudln't get it run.

I used (in Mainframe.py):
        self.il = wxImageList(16, 16)
        self.il.Add(wxBitmap('xpm/up_dir.xpm'))
        self.il.Add(wxBitmap('xpm/folder.xpm'))
        self.il.Add(wxBitmap('xpm/blank.xpm'))

> I'm assuming that it would be displayed the image within
> a file beside the filename and so on.
>

yes, that's right.

> You obviously know what you're about with respect to
> Win32 Shell functions and so on, and you're obviously
> using ctypes (and calldll) already. So which bit is
> it that doesn't work? Or what happens when you try?

Maybe I explained a little to less. I'v updated "my wxPyAtol" Homepage
a
little:
http://my.heim.at/franciss. (I hope, it works)

As a second mail, I received, Niki Spahiev recommends to use the
wxpython
mime manager from the demo.
But in wxwindows, that seems so easy to initialize the imagelist with:
  m_hImageList = SHGetFileInfo(".txt", FILE_ATTRIBUTE_NORMAL, &sfi,
sizeof(SHFILEINFO), dwFlags );


>
> To answer what I think your question is: there's no
> other way in Python at the moment to extract the
> image from a file (apart from an insane attempt to
> open arbitrary files and look for byte-patterns!).
> win32all doesn't wrap SHGetFileInfo, so ctypes / calldll
> is your only way.

Yes, I will try this, but I'm not expert at the ctypes / calldll
things,
but I keep going learning :)

best regards

-- 
Francesco



More information about the Python-list mailing list