examples/component/window.cpp

    //Copyright2023ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<ftxui/component/component.hpp>
    #include<ftxui/component/screen_interactive.hpp>

    usingnamespaceftxui;

    ComponentDummyWindowContent(){
    classImpl:publicComponentBase{
    private:
    boolchecked[3]={false,false,false};
    floatslider=50;

    public:
    Impl(){
    Add(Container::Vertical({
    Checkbox("Checkme",&checked[0]),
    Checkbox("Checkme",&checked[1]),
    Checkbox("Checkme",&checked[2]),
    Slider("Slider",&slider,0.f,100.f),
    }));
    }
    };
    returnMake<Impl>();
    }

    intmain(){
    intwindow_1_left=20;
    intwindow_1_top=10;
    intwindow_1_width=40;
    intwindow_1_height=20;

    autowindow_1=Window({
    .inner=DummyWindowContent(),
    .title="Firstwindow",
    .left=&window_1_left,
    .top=&window_1_top,
    .width=&window_1_width,
    .height=&window_1_height,
    });

    autowindow_2=Window({
    .inner=DummyWindowContent(),
    .title="Mywindow",
    .left=40,
    .top=20,
    });

    autowindow_3=Window({
    .inner=DummyWindowContent(),
    .title="Mywindow",
    .left=60,
    .top=30,
    });

    autowindow_4=Window({
    .inner=DummyWindowContent(),
    });

    autowindow_5=Window({});

    autowindow_container=Container::Stacked({
    window_1,
    window_2,
    window_3,
    window_4,
    window_5,
    });

    autodisplay_win_1=Renderer([&]{
    returntext("window_1:"+//
    std::to_string(window_1_width)+"x"+
    std::to_string(window_1_height)+"+"+
    std::to_string(window_1_left)+","+
    std::to_string(window_1_top));
    });

    autolayout=Container::Vertical({
    display_win_1,
    window_container,
    });

    autoscreen=ScreenInteractive::Fullscreen();
    screen.Loop(layout);

    returnEXIT_SUCCESS;
    }