Code: Select all
void GUIManager_Editor::PopulateListBox(string sListboxName, vector<string> vOptions)
{
CEGUI::WindowManager& windowManager = CEGUI::WindowManager::getSingleton();
CEGUI::Listbox* pListbox = (CEGUI::Listbox*)(windowManager.getWindow(sListboxName.c_str()));
for (unsigned int i = 0; i < vOptions.size(); ++i)
{
pListbox->addItem(new CEGUI::ListboxTextItem(vOptions[i].c_str()));
}
}
This is causing a crash when the text item is added. Specifically, it's crashing a crash on line 302 of ceguilistbox.cpp in Listbox::addItem.
It says Debug assertion failed: invalid Null pointer. The passed ListboxItem* is not Null.
The listbox works fine if I populate it from a layout file, but I need to be able to add to it at runtime. Any ideas?
Edit: Not sure if it's relevant, but the window is being created with the following xml:
Code: Select all
<Window Type="WindowsLook/ItemListbox" Name="TileDirSelectListBox" >
<Property Name="UnifiedPosition" Value="{{0.155,0},{0.206,0}}" />
<Property Name="UnifiedSize" Value="{{0.14,0},{0.755,0}}" />
</Window>