You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
make a GLUI_List called lbSeries, put 2 items in it
make a button that tries to perform an operation based the selected item's text
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
reply 1
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.
The text was updated successfully, but these errors were encountered:
https://sourceforge.net/p/glui/bugs/21/
initial report
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
reply 1
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.
The text was updated successfully, but these errors were encountered: