Deallocation handled by Listbox?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

User avatar
wizzler
Just popping in
Just popping in
Posts: 10
Joined: Sat Jan 30, 2010 15:28

Deallocation handled by Listbox?

Postby wizzler » 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?

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?

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Deallocation handled by Listbox?

Postby CrazyEddie » Sat Jan 30, 2010 18:25

Hi,

Using the approach you have at the moment, the items will automatically be deleted by the Listbox.

HTH

CE.

User avatar
wizzler
Just popping in
Just popping in
Posts: 10
Joined: Sat Jan 30, 2010 15:28

Re: Deallocation handled by Listbox?

Postby wizzler » Sat Jan 30, 2010 22:46

CrazyEddie wrote:Hi,

Using the approach you have at the moment, the items will automatically be deleted by the Listbox.

HTH

CE.


sounds great! thanks for the reply.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 15 guests