GLUI_List can't find last item
Brought to you by:
nigels
1) make a GLUI_List called lbSeries, put 2 items in it
2) make a button that tries to perform an operation based the selected item's text
3) control_cb callback for the button click:
int id= lbSeries->get_current_item();
GLUI_List_Item* item = lbSeries->get_item_ptr(id);
engine->DoSomething(std::string(item->text.c_str()));
Works fine for the 1st item in the list. For item #2, lbSeries->get_item_ptr(1) always returns NULL, even though the current item selected is id==1
Logged In: YES
user_id=821871
Originator: NO
This is because get_item_ptr works off id's (which are intrinsic to list items) while get_current_item returns an ordinal index.
The list API needs work.