I'm using C++ to create a GLUI window. I have a radio button, and I am trying to get the two options I have to have different callbacks.
For now, this is my code:
radio = glui->add_radiogroup_to_panel(panel_1, NULL,
RADIOBUTTON_ID,control_cb);
glui->add_radiobutton_to_group( radio, "Choice1");
glui->add_radiobutton_to_group( radio, "Choice2");
I am trying to get the value of the radio group, either 0 or 1, to then pass an if loop to control_cb
case RADIOBUTTON_ID:
int choice = /*value of radiobutton*/
if (choice == 0) printf("Hello");
else printf("world");
The question is, how to get that value for int choice?
Thank you!
Use the
RadioGroup
methodget_int_val()
: