瀏覽代碼

Demo: Console: Add a "Scroll to bottom" button (#662)

ocornut 9 年之前
父節點
當前提交
339e191c53
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      imgui_demo.cpp

+ 2 - 1
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();