17 using namespace ftxui;
18 auto screen = ScreenInteractive::FitComponent();
21 int custom_loop_count = 0;
24 auto component = Renderer([&] {
27 text(
"これはカスタムftxui::Loopの使用例です。これは、"),
28 text(
"毎秒100回のイテレーションで実行されます。FTXUIイベントは、"),
29 text(
"イテレーションごとに一度すべて処理され、新しいフレームが"),
30 text(
"必要に応じてレンダリングされます"),
32 text(
"ftxui event count: " + std::to_string(event_count)),
33 text(
"ftxui frame count: " + std::to_string(frame_count)),
34 text(
"Custom loop count: " + std::to_string(custom_loop_count)),
39 component |= CatchEvent([&](
Event) ->
bool {
44 Loop loop(&screen, component);
46 while (!loop.HasQuitted()) {
49 std::this_thread::sleep_for(std::chrono::milliseconds(10));