TGListBox elements IDs

Hi all
I have a quick question about the TGListBox class. Each entry is inserted/added into this object either by using any of the described member functions

virtual void AddEntry(TGString* s, Int_t id)
virtual void AddEntry(const char* s, Int_t id)
virtual void AddEntry(TGLBEntry* lbe, TGLayoutHints* lhints)
virtual void AddEntrySort(TGString* s, Int_t id)
virtual void AddEntrySort(const char* s, Int_t id)
virtual void AddEntrySort(TGLBEntry* lbe, TGLayoutHints* lhints)

Redirecting your attention to the difference of these methods, do elements in a TGListBox need to be sorted? this sorting is based to the id number of the elements, right? I am about to implement some new function in my main program and it will require to mix (aka. unsort) the order of the list. So far all the items are sorted based on id.

Thank you

Hi,

The entries don’t have to be sorted, it is up to you to decide… AddEntry() will append the new entry at the end of the list. In this case, it is up to you to take care of the order in your list box.

EDIT: And yes, sorting is done using the entry id

Cheers, Bertrand.