examples/component/resizable_split.cpp

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<memory>//forshared_ptr,allocator,__shared_ptr_access

    #include"ftxui/component/captured_mouse.hpp"//forftxui
    #include"ftxui/component/component.hpp"//forRenderer,ResizableSplitBottom,ResizableSplitLeft,ResizableSplitRight,ResizableSplitTop
    #include"ftxui/component/component_base.hpp"//forComponentBase
    #include"ftxui/component/screen_interactive.hpp"//forScreenInteractive
    #include"ftxui/dom/elements.hpp"//forElement,operator|,text,center,border

    usingnamespaceftxui;

    intmain(){
    autoscreen=ScreenInteractive::Fullscreen();

    automiddle=Renderer([]{returntext("middle")|center;});
    autoleft=Renderer([]{returntext("Left")|center;});
    autoright=Renderer([]{returntext("right")|center;});
    autotop=Renderer([]{returntext("top")|center;});
    autobottom=Renderer([]{returntext("bottom")|center;});

    intleft_size=20;
    intright_size=20;
    inttop_size=10;
    intbottom_size=10;

    autocontainer=middle;
    container=ResizableSplitLeft(left,container,&left_size);
    container=ResizableSplitRight(right,container,&right_size);
    container=ResizableSplitTop(top,container,&top_size);
    container=ResizableSplitBottom(bottom,container,&bottom_size);

    autorenderer=
    Renderer(container,[&]{returncontainer->Render()|border;});

    screen.Loop(renderer);
    }