Deallocation handled by Listbox?
Posted: Sat Jan 30, 2010 15:35
Hey.
I found this snippet that i've modified on the wiki and i was wondering if the heap allocation is later handled by the listbox?
Is there another, perhaps proper way of doing this?
I found this snippet that i've modified on the wiki and i was wondering if the heap allocation is later handled by the listbox?
Code: Select all
CEGUI::String text("test");
ListboxTextItem* item = new ListboxTextItem(text);
Listbox* chatBox = static_cast<Listbox*>(CEGUI::WindowManager::getSingletonPtr()->getWindow("/ChatBox/List"));
chatBox->addItem(item);
Is there another, perhaps proper way of doing this?