examples/component/checkbox_in_frame.cpp

    //Copyright2020ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<array>//forarray
    #include<memory>//forshared_ptr,__shared_ptr_access
    #include<string>//foroperator+,to_string

    #include"ftxui/component/captured_mouse.hpp"//forftxui
    #include"ftxui/component/component.hpp"//forCheckbox,Renderer,Vertical
    #include"ftxui/component/component_base.hpp"//forComponentBase
    #include"ftxui/component/screen_interactive.hpp"//forScreenInteractive
    #include"ftxui/dom/elements.hpp"//foroperator|,Element,size,border,frame,vscroll_indicator,HEIGHT,LESS_THAN

    usingnamespaceftxui;

    intmain(){
    std::array<bool,30>states;

    autocontainer=Container::Vertical({});
    for(inti=0;i<30;++i){
    states[i]=false;
    container->Add(Checkbox("Checkbox"+std::to_string(i),&states[i]));
    }

    autorenderer=Renderer(container,[&]{
    returncontainer->Render()|vscroll_indicator|frame|
    size(HEIGHT,LESS_THAN,10)|border;
    });

    autoscreen=ScreenInteractive::FitComponent();
    screen.Loop(renderer);

    return0;
    }