From 785f51227a5222b83cb5fd21984fd32d0dc4eb3a Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 7 Aug 2016 19:07:24 +0200 Subject: [PATCH] Demo tweaks --- imgui_demo.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/imgui_demo.cpp b/imgui_demo.cpp index 6f0f7135..ff946e06 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -527,9 +527,10 @@ void ImGui::ShowTestWindow(bool* p_open) ImGui::TreePop(); } - static bool a=false; - if (ImGui::Button("Button")) { printf("Clicked\n"); a ^= 1; } - if (a) + static int clicked = 0; + if (ImGui::Button("Button")) + clicked++; + if (clicked & 1) { ImGui::SameLine(); ImGui::Text("Thanks for clicking me!"); @@ -1833,9 +1834,11 @@ static void ShowExampleMenuFile() ImGui::EndChild(); static float f = 0.5f; static int n = 0; + static bool b = true; ImGui::SliderFloat("Value", &f, 0.0f, 1.0f); ImGui::InputFloat("Input", &f, 0.1f); ImGui::Combo("Combo", &n, "Yes\0No\0Maybe\0\0"); + ImGui::Checkbox("Check", &b); ImGui::EndMenu(); } if (ImGui::BeginMenu("Colors"))