I’m having a problem with the TGListBox widget. If more than 2048 items are added it has problems displaying them. The top item is overwritten and there are blank entries at the end (see example code and scroll down to the end). It still gives the correct number of items through the GetNumberOfEntries() method, though.
void testListBox()
{
// main frame
TGMainFrame *fMainFrame = new TGMainFrame(gClient->GetRoot(),0,0,kMainFrame | kVerticalFrame);
// list box
fListBox = new TGListBox(fMainFrame);
fListBox->Resize(200,300);
fMainFrame->AddFrame(fListBox, new TGLayoutHints());
fMainFrame->MapSubwindows();
// add 2100 items to the list box
const int nEntries = 2100;
for(int i=0;i<nEntries;++i){
ostringstream entryText;
entryText << i;
fListBox->AddEntry(entryText.str().c_str(), i);
}
fListBox->Layout();
fMainFrame->Resize(fMainFrame->GetDefaultSize());
fMainFrame->MapWindow();
}