wjakob / nanogui

Minimalistic GUI library for OpenGL
Other
4.66k stars 608 forks source link

How can I create a Checkbox in libigl? #53

Closed chenming-wu closed 8 years ago

chenming-wu commented 8 years ago

Hi! I want to add a Checkbox to my viewer in libigl. However, I can only add variable, button, variable, widget and window by viewer.ngui default member functions. After referring to example2 in Nanogui, I add the following code but failed.

CheckBox *cb = new CheckBox(viewer.ngui->window(), "Flag 1",
    [](bool state) { cout << "Check box 1 state: " << state << endl; }
);
cb->setChecked(true);

Can anyone help me on solving this problem and add a customized Checkbox? Thanks in advance.

wjakob commented 8 years ago

Looks right to me, not sure what the issue is..