Page 1 of 1

Listbox problem

Posted: Thu Dec 27, 2007 1:23 pm
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?

Posted: Thu Dec 27, 2007 5:39 pm
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