[SOLVED]ListBoxItem setText() problem
Posted: Wed Jul 13, 2011 12:37
Hi, i have implemented this code for setting text values in multicolumn list items.
all items are class: ListBoxTextItem
My problem is, when i call setText on object item. First time, everything is ok, text in item changes to what i want. But second,third, etc..., the text stays the value, that it was in first call.
This code implements score table values changing, when player gets point. Where is the problem? i Tried everything.
all items are class: ListBoxTextItem
Code: Select all
for (it = m_db.begin(); it < m_db.end(); it++)
{
if (it->m_idPrefix == idPrefix)
{
it->m_score++;
char text[20];
sprintf(text,"%d",it->m_score);
unsigned int rowIndex = m_mclScore->getRowWithID(it->GetIdPrefix());
CEGUI::ListboxItem * item = m_mclScore->getItemAtGridReference(CEGUI::MCLGridRef(rowIndex,1));
item->setText(text); //problem here
break;
}
}
My problem is, when i call setText on object item. First time, everything is ok, text in item changes to what i want. But second,third, etc..., the text stays the value, that it was in first call.
This code implements score table values changing, when player gets point. Where is the problem? i Tried everything.