18 using namespace ftxui;
19 auto screen = ScreenInteractive::FitComponent();
22 int custom_loop_count = 0;
25 auto component = Renderer([&] {
28 text(
"Ceci démontre l'utilisation d'une ftxui::Loop personnalisée. Elle "),
29 text(
"s'exécute à 100 itérations par seconde. Les événements FTXUI "),
30 text(
"sont tous traités une fois par itération et une nouvelle image "),
31 text(
"est rendue si nécessaire"),
33 text(
"ftxui event count: " + std::to_string(event_count)),
34 text(
"ftxui frame count: " + std::to_string(frame_count)),
35 text(
"Custom loop count: " + std::to_string(custom_loop_count)),
40 component |= CatchEvent([&](
Event) ->
bool {
47 while (!loop.HasQuitted()) {
50 std::this_thread::sleep_for(std::chrono::milliseconds(10));