examples/dom/size.cpp

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<ftxui/dom/elements.hpp>//foroperator|,text,Element,hcenter,Fit,hbox,size,window,Elements,bold,dim,EQUAL,WIDTH
    #include<ftxui/screen/screen.hpp>//forScreen
    #include<memory>//forallocator,shared_ptr
    #include<string>//forstring,to_string
    #include<utility>//formove

    #include"ftxui/dom/node.hpp"//forRender
    #include"ftxui/screen/color.hpp"//forftxui

    intmain(){
    usingnamespaceftxui;
    automake_box=[](conststd::string&title){
    returnwindow(text(title)|hcenter|bold,
    text("content")|hcenter|dim);
    };

    Elementscontent;
    for(intx=3;x<30;++x){
    content.push_back(make_box(std::to_string(x))|size(WIDTH,EQUAL,x));
    }

    autodocument=hbox(std::move(content));
    autoscreen=Screen::Create(Dimension::Fit(document));
    Render(screen,document);
    screen.Print();

    return0;
    }