Re: image files packaged into single file executalble py pyinstaller

Dietmar Schwertberger <[email protected]>
Newsgroups gmane.comp.python.wxglade
Message-ID <[email protected]>
On 11/2/2017 1:14 PM, Brendan Simon (eTRIX) wrote:
> *How can wxglade be used to design a GUI with an image, and satisfy 
> pyinstaller (without having to edit the wxglade generated files !!)*
>
> My only thought is some kind of automatic post processing, after 
> wxglage has generated the files, to ratchet in the appropriate code.  
> Are there hooks in wxglade for this?

I don't think that wxPython has a hook for this. There's 
wx.ArtProvieder, but that does not seem suitable for this purpose.

For sure the bitmap handling needs to see an improvement in terms of 
user friendliness and features.
There's also an open feature request #37 for a similar problem.
Let me put that on the list for release 0.9.


For the time being, you could use the code: statement for this purpose.
Don't enter a path to a bitmap but this instead:

     code:wxBitmap(resource_path("myimage.png"))

This is not very nice as Design and Preview window will not display the 
image, though.

Also, you need to add a suitable import statement as dependency to one 
object or to the generated code file.


But honestly, personally I would not want to use an application that 
unpacks files to a temporary directory every time it's run. I would 
expect that I can at least have a file-like object to read the file 
contents directly.


Regards,

Dietmar

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
wxGlade-general mailing list
wxGlade-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/wxglade-general
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.