FTXUI/examples/component/checkbox.cpp

26 lines
857 B
C++
Raw Normal View History

#include "ftxui/component/captured_mouse.hpp" // for ftxui
#include "ftxui/component/component.hpp" // for Checkbox, Vertical
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
2019-01-13 05:25:49 +08:00
using namespace ftxui;
2021-05-13 17:44:47 +08:00
int main(int argc, const char* argv[]) {
2021-05-10 02:32:27 +08:00
bool build_examples_state = false;
bool build_tests_state = false;
bool use_webassembly_state = true;
2021-05-13 17:44:47 +08:00
auto component = Container::Vertical({
Checkbox("Build examples", &build_examples_state),
Checkbox("Build tests", &build_tests_state),
Checkbox("Use WebAssembly", &use_webassembly_state),
2021-05-10 02:32:27 +08:00
});
2020-03-23 05:32:44 +08:00
2019-01-20 05:06:05 +08:00
auto screen = ScreenInteractive::TerminalOutput();
2021-05-13 17:44:47 +08:00
screen.Loop(component);
2019-01-13 05:25:49 +08:00
return 0;
}
2020-09-06 19:46:56 +08:00
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.