jeudi 19 septembre 2019

How do I add a callback function to nanogui checkbox?

gui_1->addVariable("bool on/off", bvar);

This is the code to form a checkbox. I want to call a function on switching the checkbox state.

I am not sure why, but I am not able to use this

CheckBox *cb = new CheckBox(window, "Flag 1",
    [](bool state) { std::cout << "Check box 1 state: " << state << std::endl; }
);

It gives me a Checkbox undefined error

What do I do?




Aucun commentaire:

Enregistrer un commentaire