Re: [ROOTDEV] TGListBox

From: Bertrand Bellenot <bertrand.bellenot_at_cern.ch>
Date: Wed, 19 Nov 2008 21:54:32 +0100


Hi Pablo,

Try this:

   for (Int_t i=0, j=0; i<fListBox->GetNumberOfEntries();j++) {

      TGTextLBEntry *entry = (TGTextLBEntry *)fListBox->GetEntry(j);
      if (entry) {
         printf("%2d = %2d; %s\n", i, entry->EntryId(), entry->GetTitle());
         i++;
      }

   }

Cheers,
Bertrand.

Lacentre Pablo Eduardo wrote:
>
> Dear Rooters,
>
> Could you tell me how to print out (cout << ?) the whole content of a
> TGListBox ? The list is composed just by names.
> The problem is that after removing items, the id's are no longer
> consecutive numbers and I think I need an iterator to find out
> the right id's for the remaining items in the list.
>
> Thanks,
> Pablo Lacentre
>
>
> Si no es necesario no imprima este correo. Todos somos responsables por el cuidado del medio ambiente.
> Este es un mensaje confidencial. El mismo contiene informacion reservada que no puede ser difundida. Si Usted ha recibido este e-mail por error, por favor avisenos inmediatamente via correo electronico y tenga la amabilidad de eliminarlo de su sistema. No debera copiar el mensaje ni divulgar su contenido. Muchas gracias
> This message is confidential. It contains information that is privileged and legally exempt from disclosure. If you have received this e-mail by mistake, please let us know immediately by e-mail and delete it from your system, you should also not copy the message nor disclose its contents to anyone. Thank you
>
>
>
Received on Wed Nov 19 2008 - 21:54:29 CET

This archive was generated by hypermail 2.2.0 : Sun Nov 23 2008 - 05:50:03 CET