playground/ExampleApps/ExampleAppAutoResize.cpp
// Demonstrate creating a window which gets auto-resized according to its content.
Demonstrate creating a window which gets auto-resized according to its content.
Demonstrate creating a window which gets auto - resized according to its content .
static void ShowExampleAppAutoResize(bool* p_open)
{
    if (!ImGui::Begin("Example: Auto-resizing window", p_open, ImGuiWindowFlags_AlwaysAutoResize))
    {
        ImGui::End();
        return;
    }
    DEMO_MARKER("Examples/Auto-resizing window");
    static int lines = 10;
    ImGui::TextUnformatted(
        "Window will resize every-frame to the size of its content.\n"
        "Note that you probably don't want to query the window size to\n"
        "output your content because that would create a feedback loop.");
    ImGui::SliderInt("Number of lines", &lines, 1, 20);
    for (int i = 0; i < lines; i++)
        ImGui::Text("%*sThis is line %d", i * 4, "", i); 
    ImGui::End();
}
static void ShowExampleAppAutoResize ( bool * p_open ) { if ( ! ImGui :: Begin ( " " , p_open , ImGuiWindowFlags_AlwaysAutoResize ) ) { ImGui :: End ( ) ; return ; } DEMO_MARKER ( " " ) ; static int lines = 10 ; ImGui :: TextUnformatted ( " \n " " \n " " " ) ; ImGui :: SliderInt ( " " , & lines , 1 , 20 ) ; for ( int i = 0 ; i < lines ; i ++ ) ImGui :: Text ( " " , i * 4 , " " , i ) ; ImGui :: End ( ) ; }
Demonstrate creating a window which gets auto-resized according to its content.
Demonstrate creating a window which gets auto - resized according to its content .
// Pad with space to extend size horizontally