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:andr...@falkenhahn.com


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to