On 6/12/07, Andre <[EMAIL PROTECTED]> wrote:
> Hello
>
> the following behaviour might be intended:
>
> wx.wxFileName.GetCwd() -- works
>                        -- wx.wxFileName:GetCwd()does not work

This is right, there is no way to know if the lua code uses '.' or ':'
(which pushes the self onto the stack) and therefore we don't know if
we should remove it and so the function fails. All static functions
are accessed using the '.' notation and NEVER ':'. Think of it this
way, static class member functions do not need to be called from an
object and therefore you don't use ':' which puts the object on the
stack.

> cwd = wx.wxFileName.Cwd -- works (but unexpectedly sets cwd to nil)

Properties do not work for static functions called on the class table
since they are already pushed into the table. This means that we
cannot automatically try to generate properties and I think it would
be more confusing than anything to also add 'Cwd' to the table. Try
the code below.

for k, v in pairs(wx.wxFileName) do print(k, v) end
SplitPath       function: 0152F7C0
GetCwd  function: 0152F438
SplitPathVolume function: 0152F860
...

> -- given
> fn = wx.wxFileName("xx.lua")
> -- then
> fn.GetCwd() --works -- would expect fn:GetCwd() and fn.Cwd to work
>                     -- they both fail

I have fixed it so that "fn.Cwd" works now, but again, "fn:GetCwd()"
is wrong and simply cannot be made to work reliably unless we can find
out if '.' or ':' was used (which we can't).

I have also rewritten some of the wxlua.html docs to clarify this,
please see the section "C++ Classes CLASS_NAME" and below. Does this
explain things well enough?

http://wxlua.cvs.sourceforge.net/wxlua/wxLua/docs/wxlua.html?view=log

Also, there is a complete list of all things possible with the
bindings here. I've hopefully tested everything that is designed to
work in some way or another. If you can think of any more tests that
would be great as I want this program to test everything.

http://wxlua.cvs.sourceforge.net/wxlua/wxLua/samples/unittest.wx.lua?view=markup

Thanks,
    John Labenski

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to