MyGUI use Multilist        
Print
Multilist filling example code
const MyGUI::IntSize & size = mMultilist->getClientCoord().size();
mMultilist->addColumn("Key", size.width / 2);
mMultilist->addColumn("Value", size.width / 2);
 
mMultilist->removeAllItems();
for (VectorStringPairs::iterator iterProperty = widgetContainer->mUserString.begin(); iterProperty != widgetContainer->mUserString.end(); ++iterProperty)
{
   // add new line and set first element (column 0, aka "Key") in this line
   mMultilist->addItem(iterProperty->first);
   // set item at 1st column (aka "Value") last line (mMultilist->getItemCount() - 1)
   mMultilist->setSubItemNameAt(1, mMultilist->getItemCount() - 1, iterProperty->second);
}

 
So addItem adds a line and 1st element of it. To set something in other columns you should use setSubItemNameAt.


Contributors to this page: jacmoe133512 points  and Altren595 points  .
Page last modified on Monday 27 of September, 2010 22:10:44 UTC by jacmoe133512 points .


The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.