16 using namespace ftxui;
18 auto screen = ScreenInteractive::Fullscreen();
22 std::cout <<
"This is a child program using stdin/stdout." << std::endl;
23 for (
int i = 0; i < 10; ++i) {
24 std::cout <<
"Please enter 10 strings (" << i <<
"/10)" << std::flush;
26 std::getline(std::cin, input);
30 auto btn_quit = Button(
"Quit", screen.ExitLoopClosure());
32 auto layout = Container::Horizontal({
38 auto explanation = paragraph(
39 "单击此按钮后,ScreenInteractive 将被 "
40 "暂停,并且对 stdin/stdout 的访问将暂时 "
51 element = element | borderEmpty | border | size(WIDTH, LESS_THAN, 80) |
52 size(HEIGHT, LESS_THAN, 20) | center;
Element borderEmpty(Element child)
在元素周围绘制一个空边框。
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase