Listbox problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
sanctus2099
Posts: 18
Joined: Sat Nov 17, 2007 11:34 am

Listbox problem

Post by sanctus2099 »

Hi I made a list and added some elements on it and everythign is fine.
now... using this code I add some Items to another list

Code: Select all

if(vector_elements.size())
				{
					for(int i =0;i<vector_elements.size();i++)
					{
						text2 = new wchar_t[strlen(vector_elements[i].c_str()) + 1]; 
						mbstowcs(text2, vector_elements[i].c_str(), strlen(vector_elements[i].c_str()) + 1);
						listbox->addItem(text2);
						
					}
				}
everything is ok as it adds the items just that only the first is selectable... as in the others are disabled.
Do you have any ideea why does this happen?
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I don't know the cause of your problem, I'm looking at the code in CGUIListBox.cpp and I don't see anything that allows the items to be 'disabled'. There is an override color per item that can be enabled or disabled, but I see nothing that disallows selection of items.

I do know that you are leaking memory... You allocate a wchar_t array on the heap, but never deallocate it.

Travis
Post Reply