From: John L. <jla...@gm...> - 2006-11-30 05:47:14
|
On 11/30/06, Pierric <sta...@gm...> 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 |