Hi John,

I believe i managed to merge your changes in, and i can generate the binding for the sample i made.
They are called like this wxluacan_BindingInit etc.

In the next routine,  the nameSpace is indeed set to wx.

void wxLuaBinding::RegisterBinding(const wxLuaState& wxlState, bool registerTypes)
{
   int luaTable = RegisterFunctions(wxlState, registerTypes);

   lua_State *L = wxlState.GetLuaState();
   // create a global
   lua_pushstring(L, wx2lua(nameSpace));
   lua_pushvalue(L, luaTable);
   lua_rawset(L, LUA_GLOBALSINDEX);
   lua_pop(L, 1);
}

But it does NOT work.
I think there are two tables created with the same name now?

Things like this do not work in a script

canvas = wx.GetCan()
canobjrect = wx.wxlCanObjRect( 30, 40, 100, 20)

But this one does:

blah = wx.wxPageSetupDialogData()
blah:GetPaperSize()

If i change the order of binding the bindings again ( like i did with the two different namespaces )

int LUACALL wxLuaBinding::RegisterFunctions(const wxLuaState& wxlState_, bool registerTypes)
{

   // Register bindings
   wxLuaBindingList::Node *node;
//for (node = M_WXLSTATEDATA->m_bindings.GetFirst(); node; node = node->GetNext() ) for (node = M_WXLSTATEDATA->m_bindings.GetLast(); node; node = node->GetPrevious() )
   {
       wxLuaBinding* binding = node->GetData();
       binding->RegisterBinding(L, registerTypes);
   }

The situation is reversed again.
meaning this works:
canvas = wx.GetCan()
canobjrect = wx.wxlCanObjRect( 30, 40, 100, 20)

And this not:
blah = wx.wxPageSetupDialogData()
blah:GetPaperSize()


The situation is different from the two namespace situation, since in there the methods where called with the wrong pclass in wxLua_lua_getTableFunc.
But knwo i do not even arrive there, lua does not know the functions.

In short i think there is realy a bug with registrating/calling function from different bindings, but it is not visible now, since two namespace tables with the same name, does not bring me two that stage anymore.

I think we should add my sample to CVS, and then try to find the errors.
Without solving this issue wxLua is not usable yet i think.

What do you think?

Klaas

John Labenski wrote:

Sorry about the delay, I've been away for a bit.

k. holwerda wrote:
I think there is someting wrong with the whole binding registration,
and that because of that things get mixed up.

I've changed genwxbind.lua to have hook_lua_namespace and
hook_cpp_namespace instead of just hook_namespace so that you can have
the same namespace for lua, but different namespaces for the generated
C++ code. See bindings/wxwidgets/wx.rules for how you should define
them. Let me know if this fixes it for you?

Regards,
   John Labenski


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=k&kid3432&bid#0486&dat1642
_______________________________________________
Wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users

--
Unclassified



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to