[wxPython-users] embed images for wxpython

Robin Dunn robin at alldunn.com
Thu May 3 21:00:47 PDT 2007


bradleyd wrote:
> Hello everyone,
> I am having trouble with a wxpython app. I have some images on the ui 
> and they are hardcoded into the code:
> self.bitmap_1 = wx.StaticBitmap(self, -1, wx.Bitmap("images/log2.png", 
> wx.BITMAP_TYPE_ANY))
> self.bitmap_2 = wx.StaticBitmap(self, -1, wx.Bitmap("images/logo4.png", 
> wx.BITMAP_TYPE_ANY))
> 
> This works great if I run the application from it's own folder. If I 
> make a desktop launcher the images do not show because they are looking 
> for images folder. I can not hardcode my own path 
> /home/me/app-folder/images , because this app will be installed on 
> multiple machines in different home directories. Is there a way to embed 
> the image? or some other way to point to install directory image folder?
> Thanks,
> Brad
> p.s. I am freezing the app before install on other machines.


See the img2py tool.


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list