Re: [ROOT] Loop over TGListBox

From: Valeriy Onuchin (Valeri.Onoutchine@cern.ch)
Date: Mon Aug 25 2003 - 16:43:39 MEST


Hi Christian, 
any contributions are welcome.  
Create new version of TGListBox -> test it -> send new version to rootdev.

Thanks. Regards. Valeriy

> Dear Rooters
> 
> Since I had a hard time to figure out how to loop over all
> TGListBox entries:
> 
> // Select all entries
>    TList *entries = ((TGLBContainer*)(fListBox->GetContainer()))->GetList();
>    TIter next(entries);
>    TGFrameElement *el;
>    TGTextLBEntry *entry;
>    while ((el = (TGFrameElement*)next())) {
>       entry = (TGTextLBEntry*)el->fFrame;
>       fListBox->Select(entry->EntryId(), kTRUE);
>    }
> 
> I would like to suggest to add the following method to TGListBox:
> 
>    TList *TGListBox::GetList()
>          {return ((TGLBContainer*)GetContainer())->GetList();}
> (Method not tested)
> 
> I am not sure if it is possible to get TGTextLBEntry directly?
> 
> Best regards
> Christian
> _._._._._._._._._._._._._._._._
> C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a
> V.i.e.n.n.a       A.u.s.t.r.i.a
> _._._._._._._._._._._._._._._._
> 
> 
> 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:15 MET