How to Get the String from a listbox?

[size=150]
Hello, all,
I creat two listbox and fill in lots of entries. Then I hope to select the entries by mouse and move them from one to another. But I didn’t find the way to get the string from a listbox by selection which I need it to creat a entry in another listbox. The returned value is the ID of Entry or TGLBEntry* pointer. There is also no function in class TGLBEntry avaliable to get a string.

any idea?

Thanks a lot.

[/size]

Hi,

You can do for one entry:

TGTextLBEntry *selEntry = (TGTextLBEntry *)listbox->GetSelectedEntry(); const char *te = selEntry->GetTitle();In case of multiple selection the method GetSelectedEntries(TList *list) should be used and additional loop over the list of all selected entries is needed.

Cheers, Ilka

[quote=“antcheva”]Hi,

You can do for one entry:

TGTextLBEntry *selEntry = (TGTextLBEntry *)listbox->GetSelectedEntry(); const char *te = selEntry->GetTitle();In case of multiple selection the method GetSelectedEntries(TList *list) should be used and additional loop over the list of all selected entries is needed.

Cheers, Ilka[/quote]
[size=150]
Many thanks for your great answer.

[/size]