MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / ShowExampleAppAutoResize

Function ShowExampleAppAutoResize

external/imgui/imgui_demo.cpp:9902–9920  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

9900
9901// Demonstrate creating a window which gets auto-resized according to its content.
9902static void ShowExampleAppAutoResize(bool* p_open)
9903{
9904 if (!ImGui::Begin("Example: Auto-resizing window", p_open, ImGuiWindowFlags_AlwaysAutoResize))
9905 {
9906 ImGui::End();
9907 return;
9908 }
9909 IMGUI_DEMO_MARKER("Examples/Auto-resizing window");
9910
9911 static int lines = 10;
9912 ImGui::TextUnformatted(
9913 "Window will resize every-frame to the size of its content.\n"
9914 "Note that you probably don't want to query the window size to\n"
9915 "output your content because that would create a feedback loop.");
9916 ImGui::SliderInt("Number of lines", &lines, 1, 20);
9917 for (int i = 0; i < lines; i++)
9918 ImGui::Text("%*sThis is line %d", i * 4, "", i); // Pad with space to extend size horizontally
9919 ImGui::End();
9920}
9921
9922//-----------------------------------------------------------------------------
9923// [SECTION] Example App: Constrained Resize / ShowExampleAppConstrainedResize()

Callers 1

ShowDemoWindowMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected