examples/component/textarea.cpp

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<memory>//forallocator,__shared_ptr_access,shared_ptr
    #include<string>//forstring

    #include"ftxui/component/captured_mouse.hpp"//forftxui
    #include"ftxui/component/component.hpp"//forInput,Renderer,ResizableSplitLeft
    #include"ftxui/component/component_base.hpp"//forComponentBase,Component
    #include"ftxui/component/screen_interactive.hpp"//forScreenInteractive
    #include"ftxui/dom/elements.hpp"//foroperator|,separator,text,Element,flex,vbox,border

    intmain(){
    usingnamespaceftxui;

    std::stringcontent_1;
    std::stringcontent_2;
    autotextarea_1=Input(&content_1);
    autotextarea_2=Input(&content_2);
    intsize=50;
    autolayout=ResizableSplitLeft(textarea_1,textarea_2,&size);

    autocomponent=Renderer(layout,[&]{
    returnvbox({
    text("Input:"),
    separator(),
    layout->Render()|flex,
    })|
    border;
    });

    autoscreen=ScreenInteractive::Fullscreen();
    screen.Loop(component);
    }