Subscribing Lua functions to buttons
Posted: Thu Oct 14, 2010 17:37
Is there a way of subscribing Lua functions to events for button not created in the LUA script but rather in the actual UI .layout?
You see I tried running the following code (from the wiki) in the LUA script but I kept getting Runtime errors:
You see I tried running the following code (from the wiki) in the LUA script but I kept getting Runtime errors:
Code: Select all
CEGUI::PushButton* pb = (CEGUI::PushButton*)CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/Button","lua_powered_button");
pb->setSize(CEGUI::Size(0.1f,0.1f));
pb->setPosition(CEGUI::Point(0.1f,0.1f));
pb->subscribeScriptedEvent("Clicked","luabtn_clicked");
CEGUI::System::getSingleton().getGUISheet()->addChildWindow(pb);