From 4fddfa4b5e27520ee8518e58af3cb53f26846943 Mon Sep 17 00:00:00 2001 From: ocornut Date: Tue, 7 Jun 2016 09:05:36 +0200 Subject: [PATCH] Demo: extra (somehow duplicate) Selectables+Columns demo --- imgui_demo.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/imgui_demo.cpp b/imgui_demo.cpp index c890d75a..752cd42b 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -442,6 +442,19 @@ void ImGui::ShowTestWindow(bool* p_open) ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes"); ImGui::TreePop(); } + if (ImGui::TreeNode("In columns")) + { + ImGui::Columns(3, NULL, false); + static bool selected[16] = { 0 }; + for (int i = 0; i < 16; i++) + { + char label[32]; sprintf(label, "Item %d", i); + if (ImGui::Selectable(label, &selected[i])) {} + ImGui::NextColumn(); + } + ImGui::Columns(1); + ImGui::TreePop(); + } if (ImGui::TreeNode("Grid")) { static bool selected[16] = { true, false, false, false, false, true, false, false, false, false, true, false, false, false, false, true };