Page 1 of 1

[SOLVED] Userdata is lost after removeRow (MultiColumnList)

Posted: Thu Dec 29, 2011 20:31
by saejox
Hi,

after I call removeRow only once on a single row like this;

Code: Select all

for(uint j=0; j < bag->getRowCount(); ++j)
               {
                  CEGUI::ListboxItem *listitem = bag->getItemAtGridReference(CEGUI::MCLGridRef(j,0));
                  if(listitem->getUserData() == static_cast<void*>(item))
                  {
                     bag->removeRow(j);
                     break;
                  }
               }




every listitems userdata in multicolumlist is set to userdata of the one just below it. all listitems are affected by it.

i fill the multicolumnlist like this

Code: Select all

unsigned int mRow = mListBox->addRow();
      CEGUI::ListboxTextItem* item = new CEGUI::ListboxTextItem(c1, 0);
      mListBox->setItem(item, 0, mRow);
      item->setSelected(isSelected);
      item->setSelectionBrushImage( "TaharezLook", "MultiListSelectionBrush");
      item->setUserData(data);


in short, userdata of every listbox item below the deleted one are changed.
what i am doing wrong ?
thank you

edit: i'm using cegui 0.7.5 vc++9. problem is present in both debug and relase builds.

Re: [SOLVED] Userdata is lost after removeRow (MultiColumnLi

Posted: Fri Dec 30, 2011 16:47
by saejox
solution was here;

viewtopic.php?f=3&t=4360