ANN: (very simple) foldable panels + png-> py convert utility

Hello list,

First, another control I thought somebody else might like: Foldable panels done the windows way.

Nothing fancy, but I wanted a consistant look with the rest of the os (which the 2.6 foldable panels doesn't give).
Not sure it works in osx, though...

Last but not least, I attached my convert.py utility which (when put in the proper directory) walks through the png images and generates an images.py module with the pngs as char strings and an Images class.

!!!Don't just click on the file. See what the code does, first!!! You were warned, don't blame me if some of your files get overwritten! (well, if you have a images.py file already, it is renamed to images.bak and if you have both an images.py and an images.bak, os.rename will just throw an exception, so it's not as bad as it sounds... still, check the code first)

You'll see an early version of images.py (formated by hand!) in FoldPanel.py

How it all fits together: Once you have converted your images, you can do a

import images
class YourPanel(wx.Panel,images.Images):

and the bitmaps become available to the class as bmp_...

The bitmap names are in images._names (well "bmp_"+images._names[...] ) if you need to include all of them in an imagelist or something...

I do remember of a convert utility Robin wrote ages ago to do the same thing. I thought I might write my own which I may then extend to check for valid sizes or extend it with PIL to take care of the transparent backgrounds, etc...

Cheers,
Egor

FoldPanel.py (10.7 KB)

convert.py (2.11 KB)