diff --git a/imgui_demo.cpp b/imgui_demo.cpp index 7ecb03693..a1eb682c1 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -966,10 +966,12 @@ void ImGui::ShowTestWindow(bool* opened) { ImGui::Bullet(); ImGui::TextWrapped("Horizontal scrolling for a window has to be enabled explicitly via the ImGuiWindowFlags_HorizontalScrollbar flag."); ImGui::Bullet(); ImGui::TextWrapped("You may want to explicitly specify content width by calling SetNextWindowContentWidth() before Begin()."); + static int lines = 7; + ImGui::SliderInt("Lines", &lines, 1, 15); ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 1.0f)); ImGui::BeginChild("scrolling", ImVec2(0, ImGui::GetItemsLineHeightWithSpacing()*7 + 30), true, ImGuiWindowFlags_HorizontalScrollbar); - for (int line = 0; line < 7; line++) + for (int line = 0; line < lines; line++) { // Display random stuff int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3);