On Wed, Dec 9, 2009 at 3:57 PM, Dzmitry Hancharou <[email protected]> wrote:
> Is there a way to create your own components using wxLua? I found the
Sure, each of the wxWidgets libraries could be considered separate
components, base, core, adv, html...
> only way where I create mod_wxmydll and link it with
> mod_luamodule_mono. But for this I need to recompile the entire wxLua.
I don't know why you would have to recompile all of wxLua? You compile
your module linked against wxWidgets and wxLua and then call
require("mymodule"). You need to write your own loading function like
int luaopen_wx(lua_State *L)
http://wxlua.cvs.sourceforge.net/viewvc/wxlua/wxLua/modules/luamodule/src/luamodule.cpp?view=markup
In your case you won't have all the wxApp code, but rather just run
the binding init code.
see: bool wxLuaState::Create(lua_State* L, int state_type)
and: bool wxLuaState::RegisterBindings()
http://wxlua.cvs.sourceforge.net/viewvc/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp?view=markup
Basically I would call:
int luaopen_mywxlib(lua_State *L)
{
wxLuaBinding_mywxlib_init(); // declared in generated binding header
wxLuaBinding::InitAllBindings(true); // force relinking bindings
wxLuaState wxlState(L);
wxLuaBinding* wxlBinding = wxLuaBinding::GetLuaBinding(wxT("mywxlib"));
wxlBinding->RegisterBinding(wxlState); // leaves table it was put
into on the stack
return 1;
}
I hope this helps, I do notice that some of the init code could be
cleaned up a little,
John
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users