examples/dom/gridbox.cpp

    //Copyright2021ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<stdio.h>//forgetchar
    #include<ftxui/dom/elements.hpp>//forElements,gridbox,Fit,operator|,text,border,Element
    #include<ftxui/screen/screen.hpp>//forScreen
    #include<memory>//forallocator,shared_ptr

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

    intmain(){
    usingnamespaceftxui;
    autocell=[](constchar*t){returntext(t)|border;};
    autodocument=//
    gridbox({
    {
    cell("north-west"),
    cell("north"),
    cell("north-east"),
    },
    {
    cell("center-west"),
    gridbox({
    {
    cell("center-north-west"),
    cell("center-north-east"),
    },
    {
    cell("center-south-west"),
    cell("center-south-east"),
    },
    }),
    cell("center-east"),
    },
    {
    cell("south-west"),
    cell("south"),
    cell("south-east"),
    },
    });
    autoscreen=Screen::Create(Dimension::Fit(document));
    Render(screen,document);
    screen.Print();
    getchar();

    return0;
    }