Re: [Boa Constr] absolute vs relative paths
Status: Beta
Brought to you by:
riaan
From: Riaan B. <riaan@e.co.za> - 2004-01-05 09:15:26
|
Hi Bill, Bill Harris wrote: > I am trying to build a standalone executable of the Boa tutorial program > Notebook using py2exe. I am running Windows XP Pro. > > I am running into the problem that the location for the bitmap in the dialog > (wxDialog1) is an absolute path (e.g., c:\dir1\dir2\graphic.bmp). I need to > somehow use a relative path, relative to the directory where the .exe will > be installed. > > How can I do that? There is a preference under: Preferences->General->Code generation->cgAbsoluteImagePaths = False You will have to readd the images for the source to change though. The setting only applies to setting new image properties. Simplest would be to change the setting (for future changes) and manually find/replace the root of the absolute path in the source and replace with the relative path. This will change in a later version of Boa, but to use the relative path by default actually needs another helper function to establish an application root. Boa (CVS) already supports images as python source code (via the wxPython.tools.img2py tool) This is similar to Mike's resourcepackage. You may convert an image to a python resource after opening the image (with the ImageEditor plug-in installed) and choosing File->Convert to module. Choose an existing module to add another image to that resource module. The image editor can also edit images inside python resources directly. Also see Examples/images/ResourceModules/* Cheers, Riaan. |