From 339e191c53b7ce025e5e0fa049ad24e7a4d42c9d Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 15 May 2016 18:08:41 +0200 Subject: [PATCH] Demo: Console: Add a "Scroll to bottom" button (#662) --- imgui_demo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui_demo.cpp b/imgui_demo.cpp index c252324f..fa4f026d 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -2002,7 +2002,8 @@ struct ExampleAppConsole if (ImGui::SmallButton("Add Dummy Text")) { AddLog("%d some text", Items.Size); AddLog("some more text"); AddLog("display very important message here!"); } ImGui::SameLine(); if (ImGui::SmallButton("Add Dummy Error")) AddLog("[error] something went wrong"); ImGui::SameLine(); - if (ImGui::SmallButton("Clear")) ClearLog(); + if (ImGui::SmallButton("Clear")) ClearLog(); ImGui::SameLine(); + if (ImGui::SmallButton("Scroll to bottom")) ScrollToBottom = true; //static float t = 0.0f; if (ImGui::GetTime() - t > 0.02f) { t = ImGui::GetTime(); AddLog("Spam %f", t); } ImGui::Separator();