examples/component/checkbox.cpp

    //Copyright2021ArthurSonzogni.Allrightsreserved.
    //UseofthissourcecodeisgovernedbytheMITlicensethatcanbefoundin
    //theLICENSEfile.
    #include<array>//forarray
    #include<iostream>
    #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(){
    booldownload=false;
    boolupload=false;
    boolping=false;

    autocontainer=Container::Vertical({
    Checkbox("Download",&download),
    Checkbox("Upload",&upload),
    Checkbox("Ping",&ping),
    });

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

    std::cout<<"---"<<std::endl;
    std::cout<<"Download:"<<download<<std::endl;
    std::cout<<"Upload:"<<upload<<std::endl;
    std::cout<<"Ping:"<<ping<<std::endl;
    std::cout<<"---"<<std::endl;

    return0;
    }