I think something is missing in my code because the events seem not to work properly
(The GUI is correctly displayed)
what I've done :
Code: Select all
CEGUI::LuaScriptModule *scriptmod = new CEGUI::LuaScriptModule();
new CEGUI::System(myRenderer, scriptmod, (CEGUI::utf8*)"cegui.config");
[...]
CEGUI::WindowManager &winMgr = CEGUI::WindowManager::getSingleton();
CEGUI::Window *myRoot = winMgr.loadWindowLayout("../data/schemes/demolayout.xml");
CEGUI::System::getSingleton().setGUISheet(myRoot);
with demolayout.xml
Code: Select all
[...]
<Window Type="TaharezLook/Button" Name="Button1" >
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
<Property Name="UnifiedAreaRect" Value="{{0.089232,0.000000},{0.207778,0.000000},{0.401089,0.000000},{0.315456,0.000000}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
<Event Name="Clicked" Function="luabtn_clicked" />
</Window>
[...]
and the luabtn_clicked function defined in the lua file called by "cegui.config" (called at creation of CEGUI::System) :
Code: Select all
function luabtn_clicked(e)
local logger = CEGUI.Logger:getSingleton()
logger:logEvent( ">>> clic" )
end
Just to see if everything is ok, I put a
Code: Select all
local logger = CEGUI.Logger:getSingleton()
logger:logEvent( ">>> started" )
in the lua file and it's well written in the log file, so this lua file is correctly parsed.
but, the logger:logEvent( ">>> clic" ) inside the luabtn_clicked function is not interpreted when I click the button
What is missing ?
Did I forget something ?