Oh~ I see.
I directly use solution file under build/msw instead of running "
genwxbind.bat" first. That makes the bug!
Thanks.

2006/11/30, John Labenski <[EMAIL PROTECTED]>:

On 11/30/06, Pierric <[EMAIL PROTECTED]> wrote:
> I recently find a small bug in wxbind/src/gdi.cpp,line 4193. Here is the
> original code:
> static int LUACALL wxBitmapFromFile_constructor(lua_State
> *L)
> {
>    ....
>     // call constructor
>     returns = new wxBitmap(name, type);
>     ...
>     return 1;
> }
>
> I changed to the following one :
> returns = new wxBitmap(name, (wxBitmapType)type);
>
> The reason is that the wxBitmap have two different ctor wxBitmap(const
> wxString&,wxBitmapType) and wxBitmap(const wxImage&,int depth,int depth)
and
> the second one is not implicit and the image can be constructed from a
> string. So here comes the Bug.  The "new wxBitmap(name, type); " exactly
> calls the second ctor instead the first one.

Great thanks, I fixed it in the bindings/wxwidgets/gdi.i file by
declaring the constructor as

    %constructor wxBitmapFromFile(const wxString& name, wxBitmapType
type = wxBITMAP_TYPE_ANY)

with the added benefit that the default tries to determine the file
type from the extension.

Regards,
    John Labenski

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to