Imgui buttons don't use any id or callbacks. Instead, the ImGui::Button("Clikc me")
will return a boolean which is true if the button was clicked. (here is an example)
ImGui::Begin("window");
if (ImGui::Button("Click me")) {
// onButtonClick();
}
ImGui::End();
for more read https://github.com/ocornut/imgui/tree/master/docs and seeimgui_demo.cpp
it has some better examples on how to use it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…