16 using namespace ftxui;
18 auto screen = ScreenInteractive::Fullscreen();
23 auto btn_run = Button(
"Execute with restored IO",
screen.WithRestoredIO([] {
24 std::cout <<
"This is a child program using stdin/stdout." << std::endl;
25 for (int i = 0; i < 10; ++i) {
26 std::cout <<
"Please enter 10 strings (" << i <<
"/10)" << std::flush;
28 std::getline(std::cin, input);
32 auto btn_quit = Button(
"Quit",
screen.ExitLoopClosure());
34 auto layout = Container::Horizontal({
39 auto renderer = Renderer(layout, [&] {
40 auto explanation = paragraph(
41 "Après avoir cliqué sur ce bouton, le ScreenInteractive sera "
42 "suspendu et l'accès à stdin/stdout sera temporairement "
43 "restauré pour l'exécution d'une fonction.");
45 explanation | borderEmpty,
53 element = element | borderEmpty | border | size(WIDTH, LESS_THAN, 80) |
54 size(HEIGHT, LESS_THAN, 20) | center;