FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
textarea.cpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4#include <memory> // for allocator, __shared_ptr_access, shared_ptr
5#include <string> // for string
6
7#include "ftxui/component/captured_mouse.hpp" // for ftxui
8#include "ftxui/component/component.hpp" // for Input, Renderer, ResizableSplitLeft
9#include "ftxui/component/component_base.hpp" // for ComponentBase, Component
10#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
11#include "ftxui/dom/elements.hpp" // for operator|, separator, text, Element, flex, vbox, border
12
13int main() {
14 using namespace ftxui;
15
16 std::string content_1;
17 std::string content_2;
18 auto textarea_1 = Input(&content_1);
19 auto textarea_2 = Input(&content_2);
20 int size = 50;
21 auto layout = ResizableSplitLeft(textarea_1, textarea_2, &size);
22
23 auto component = Renderer(layout, [&] {
24 return vbox({
25 text("Input:"),
26 separator(),
27 layout->Render() | flex,
28 }) |
29 border;
30 });
31
32 auto screen = ScreenInteractive::Fullscreen();
33 screen.Loop(component);
34}
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
int main()
Definition textarea.cpp:13