TGListBox problem

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();
}

Hi,

This was a layout issue which is now fixed in the master and in the v5-34-00-patches branch.

Cheers, Bertrand.