FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
input_in_frame.cpp
Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
2// このソースコードの使用は、LICENSEファイルにあるMITライセンスに準拠します。
3#include <memory> // for allocator, __shared_ptr_access
4#include <string> // for string, basic_string, operator+, to_string
5#include <vector> // for vector
6
7#include "ftxui/component/captured_mouse.hpp" // for ftxui
8#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
9#include "ftxui/component/component_base.hpp" // for ComponentBase
10#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
11#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
12
13int main() {
14 using namespace ftxui;
15
16 Component input_list = Container::Vertical({});
17 std::vector<std::string> items(100, "");
18 for (size_t i = 0; i < items.size(); ++i) {
19 input_list->Add(Input(&(items[i]), "placeholder " + std::to_string(i)));
20 }
21
22 auto renderer = Renderer(input_list, [&] {
23 return input_list->Render() | vscroll_indicator | frame | border |
24 size(HEIGHT, LESS_THAN, 10);
25 });
26
27 auto screen = ScreenInteractive::TerminalOutput();
28 screen.Loop(renderer);
29}
int main()
FTXUI ftxui:: 名前空間
Definition animation.hpp:9
std::shared_ptr< ComponentBase > Component
return size
Definition string.cpp:1516