MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / ShowExampleAppAutoResize

Function ShowExampleAppAutoResize

3rdparty/imgui/src/imgui_demo.cpp:9885–9903  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

9883
9884// Demonstrate creating a window which gets auto-resized according to its content.
9885static void ShowExampleAppAutoResize(bool* p_open)
9886{
9887 if (!ImGui::Begin("Example: Auto-resizing window", p_open, ImGuiWindowFlags_AlwaysAutoResize))
9888 {
9889 ImGui::End();
9890 return;
9891 }
9892 IMGUI_DEMO_MARKER("Examples/Auto-resizing window");
9893
9894 static int lines = 10;
9895 ImGui::TextUnformatted(
9896 "Window will resize every-frame to the size of its content.\n"
9897 "Note that you probably don't want to query the window size to\n"
9898 "output your content because that would create a feedback loop.");
9899 ImGui::SliderInt("Number of lines", &lines, 1, 20);
9900 for (int i = 0; i < lines; i++)
9901 ImGui::Text("%*sThis is line %d", i * 4, "", i); // Pad with space to extend size horizontally
9902 ImGui::End();
9903}
9904
9905//-----------------------------------------------------------------------------
9906// [SECTION] Example App: Constrained Resize / ShowExampleAppConstrainedResize()

Callers 1

ShowDemoWindowMethod · 0.85

Calls 2

BeginFunction · 0.85
EndFunction · 0.85

Tested by

no test coverage detected