MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / ShowExampleAppAutoResize

Function ShowExampleAppAutoResize

Source/3rdParty/imgui/imgui_demo.cpp:9787–9805  ·  view source on GitHub ↗

Demonstrate creating a window which gets auto-resized according to its content.

Source from the content-addressed store, hash-verified

9785
9786// Demonstrate creating a window which gets auto-resized according to its content.
9787static void ShowExampleAppAutoResize(bool* p_open)
9788{
9789 if (!ImGui::Begin("Example: Auto-resizing window", p_open, ImGuiWindowFlags_AlwaysAutoResize))
9790 {
9791 ImGui::End();
9792 return;
9793 }
9794 IMGUI_DEMO_MARKER("Examples/Auto-resizing window");
9795
9796 static int lines = 10;
9797 ImGui::TextUnformatted(
9798 "Window will resize every-frame to the size of its content.\n"
9799 "Note that you probably don't want to query the window size to\n"
9800 "output your content because that would create a feedback loop.");
9801 ImGui::SliderInt("Number of lines", &lines, 1, 20);
9802 for (int i = 0; i < lines; i++)
9803 ImGui::Text("%*sThis is line %d", i * 4, "", i); // Pad with space to extend size horizontally
9804 ImGui::End();
9805}
9806
9807//-----------------------------------------------------------------------------
9808// [SECTION] Example App: Constrained Resize / ShowExampleAppConstrainedResize()

Callers 1

ShowDemoWindowMethod · 0.85

Calls 4

EndFunction · 0.85
SliderIntFunction · 0.85
BeginFunction · 0.50
TextFunction · 0.50

Tested by

no test coverage detected