I have another question about CEGUI listboxes in lua. I have the following code...
Code: Select all
function ChatWindow_AddText(text)
local chatLog = CEGUI.toListbox(wndMgr:getWindow("ChatLog")) -- I use this as a global variable but just to let you know how I initialise that variable in lua is declare it in the function as local
...
chatLog:addItem(...)
end
I end up with an error: CEGUI::ScriptException in file Game.cpp(336) : Could not call event function: [string "Scripts/Windows/ChatWindow.lua"]:76: attempt to call method 'addItem' (a nil value)
Also I would like to know, what to give as parameter. I know, in cpp I should give a pointer to an instance of for example a CEGUI::ListboxTextItem. I tried this in Lua...
Code: Select all
chatLog:addItem(CEGUI.ListboxTextItem:new(text))
... and ended up with a message that new is a nil value here