You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 3 buttons created by a for loop and being drawn in a Child. I am facing some problems when clicking in buttons that do not have index 0, in fact they aren't detecting the press. The program should change focus and active variables when I click in some of those 3 buttons and the text " Selected Button is at index: x" should be printed but the button press is only be detecting when I click the first/top button.
intImGuiListViewEx(std::vector<std::string>& items, int& focus, int& scroll, int& active) {
ImGui::SetNextWindowSize(ImVec2(400, 200)); // set the container size
ImVec2 screen = ImGui::GetIO().DisplaySize;
ImVec2 childSize = ImVec2(.2 * screen.x, .7 * screen.y);
ImGui::BeginChild("Entities List", childSize, true, ImGuiWindowFlags_HorizontalScrollbar);
for (int i = 0; i < 3; i++) {
if (ImGui::Button("Hello World Button", ImVec2(120,40))) {
std::cout << "Selected Button is at index: " << i << std::endl;
focus = i;
active = i;
}
}
ImGui::EndChild();
return active;
}
I have 3 buttons created by a for loop and being drawn in a Child. I am facing some problems when clicking in buttons that do not have index 0, in fact they aren't detecting the press. The program should change
focus
andactive
variables when I click in some of those 3 buttons and the text " Selected Button is at index: x" should be printed but the button press is only be detecting when I click the first/top button.If you need some context I will past the full minimal reproducible example here: https://pastebin.com/RnSMftta
The text was updated successfully, but these errors were encountered: