From: Andreas F. <an...@fa...> - 2013-08-15 16:04:28
|
Hi, I think there is a bug in wxlua_getBindMethodArgsMsg(). Try the following code: test = wx.wxImage(1) This will raise an error because there is no constructor that just takes a single number. wxLua then shows the following error message: Error: Lua: Error while running chunk [string "untitled.lua*"]:1: wxLua: Function call has invalid argument 1 on method 05. Function called: 'wxImage(number)' 01. wxImage::wxImage(wxBitmap) 02. wxImage::wxImage(number, number [, string, boolean]) 03. wxImage::wxImage([string, number]) 04. wxImage::wxImage(number [, number, boolean]) 05. wxImage::wxImage(wxImage) 06. wxImage::wxImage() stack traceback: [C]: in function 'wxImage' [string "untitled.lua*"]:1: in main chunk Here you can see that the syntax of the single constructors is not shown correctly because the '[' bracket that indicates the beginning of the optional arguments section is always inserted one argument too early. This is caused by a wrong condition in wxlua_getBindMethodArgsMsg(). Precisely, this line if ((wxluacfuncs[i].minargs < wxluacfuncs[i].maxargs) && (arg+1 == wxluacfuncs[i].minargs)) has to be changed into this line if ((wxluacfuncs[i].minargs < wxluacfuncs[i].maxargs) && (arg == wxluacfuncs[i].minargs)) Then the output is correct: 01. wxImage::wxImage(wxBitmap) 02. wxImage::wxImage(number, number, string [, boolean]) 03. wxImage::wxImage(string [, number]) 04. wxImage::wxImage(number , number [, boolean]) 05. wxImage::wxImage(wxImage) 06. wxImage::wxImage() -- Best regards, Andreas Falkenhahn mailto:an...@fa... |