On Fri, Jun 26, 2009 at 12:54 PM, Attila<ejjeliorja...@gmail.com> wrote:
> Hello!
> I find a very good feature in DialogBlocks - adding xrc resource as a
> zipped file name myproject.xrs, then I can load the myproject.xrc from it,
> after I did the needed wxFileSystem call. But I want to add my images in
> this way too, because compressed resource uses less hard-disk space.
> DialogBlocks added it to the xrs file, but I am unable to load it.
> wxXmlResource:LoadBitmap() doesn't work, if I use the filename as it's
> parameter. I checked the wx source, and I see it does something with
> nodes, so I assume it excepts the image inside the xrc file.

I haven't used XRC to do much of anything, but I see that you can put
bitmaps into some sort of zip file that the xrc file can load. Maybe
you can google a bit and find some examples, even wxPython examples
should be easy enough to translate to wxLua.

http://docs.wxwidgets.org/trunk/overview_xrc.html#overview_xrc_binaryresourcefiles

http://books.google.com/books?id=CyMsvtgnq0QC&pg=PA409&lpg=PA409&dq=wxwidgets+xrc+wxbitmap+zip&source=bl&ots=SS8zi6DoDf&sig=SOweAv8Ymh27K8eGutWnQEtD7jM&hl=en&ei=K_xHSrqiO-Cxtwek3vjmBg&sa=X&oi=book_result&ct=result&resnum=3

> DialogBlocks
> also writes C++ file for the xrc, I checked that, it writes something like
> this:
>
> myApp::GetBitmapResource(wxString &name)
> {
>   wxUnusedVar name;
>   return wxNullBitmap;
> }
>
> Sorry if the code isn't 100% correct, I am not a C++ programmer, and the
> code isn't ahead me :) So, it returns with a nullbitmap... What should I
> do? Can I add the image into the xrc file? Or can I get them from the xrs
> file? Thanks for the replyes.

I have no idea what this code is all about, it doesn't make sense to
always return an invalid wxBitmap? Some sort of dummy code that
DialogBocks expects you to fill out?

Regards,
    John

------------------------------------------------------------------------------
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to