[SOLVED]ListBoxItem setText() problem

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

Rampage
Just popping in
Just popping in
Posts: 7
Joined: Sun Jul 03, 2011 14:18

[SOLVED]ListBoxItem setText() problem

Postby Rampage » 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

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.
Last edited by Rampage on Thu Jul 14, 2011 09:14, edited 1 time in total.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: ListBoxItem setText() problem

Postby Jamarr » Wed Jul 13, 2011 19:00

Did you try calling m_mclScore->handleUpdatedItemData() after your code finishes updating the item data?
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

Rampage
Just popping in
Just popping in
Posts: 7
Joined: Sun Jul 03, 2011 14:18

Re: ListBoxItem setText() problem

Postby Rampage » Thu Jul 14, 2011 09:14

thx, solved :)


Return to “Help”

Who is online

Users browsing this forum: Bing [Bot] and 9 guests