I'm using GLUI for user interface. I tried to add Listbox with several items. I could add items like below image, but if I clicked the one of them (None, AAA, BBB). The program was stopped. It looks like accessing NULL data.

enter image description here

The code is as follows: (I didn't to anything in control function)

GLUI *glui = GLUI_Master.create_glui_subwindow(windowID, GLUI_SUBWINDOW_RIGHT);

GLUI_Panel *objectEdit = new GLUI_Panel(glui, "Edit");

GLUI_Listbox *listboxChangeSimplification = new GLUI_Listbox(objectEdit, "Change Simplification: ", &listboxIndex,  12, control_cb);
listboxChangeSimplification->add_item(1, "None");
listboxChangeSimplification->add_item(2, "AAA");
listboxChangeSimplification->add_item(3, "BBB");

I just want that if I click the item, the white space item(current is 'None') is converted as selected item.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.