MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/Cauldron / ShowExampleAppAutoResize

Function ShowExampleAppAutoResize

libs/imgui/imgui_demo.cpp:2285–2299  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2283
2284// Demonstrate creating a window which gets auto-resized according to its content.
2285static void ShowExampleAppAutoResize(bool* p_open)
2286{
2287 if (!ImGui::Begin("Example: Auto-resizing window", p_open, ImGuiWindowFlags_AlwaysAutoResize))
2288 {
2289 ImGui::End();
2290 return;
2291 }
2292
2293 static int lines = 10;
2294 ImGui::Text("Window will resize every-frame to the size of its content.\nNote that you probably don't want to query the window size to\noutput your content because that would create a feedback loop.");
2295 ImGui::SliderInt("Number of lines", &lines, 1, 20);
2296 for (int i = 0; i < lines; i++)
2297 ImGui::Text("%*sThis is line %d", i*4, "", i); // Pad with space to extend size horizontally
2298 ImGui::End();
2299}
2300
2301// Demonstrate creating a window with custom resize constraints.
2302static void ShowExampleAppConstrainedResize(bool* p_open)

Callers 1

ShowDemoWindowMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected