Initial prototype

This commit is contained in:
Arthur Sonzogni
2018-09-18 08:48:40 +02:00
commit 49aeaa49c5
28 changed files with 857 additions and 0 deletions

1
examples/CMakeLists.txt Normal file
View File

@@ -0,0 +1 @@
add_subdirectory(text)

View File

@@ -0,0 +1,4 @@
add_executable(main
main.cpp
)
target_link_libraries(main PRIVATE ftxui)

38
examples/text/main.cpp Normal file
View File

@@ -0,0 +1,38 @@
#include "ftxui/core/screen.hpp"
#include "ftxui/core/dom/elements.hpp"
#include <iostream>
int main(int argc, const char *argv[])
{
using namespace ftxui::dom;
auto root =
vbox(
hbox(
text(L"north-west"),
flex(),
text(L"north-east")
),
flex(),
hbox(
hbox(
flex(),
text(L"center"),
flex()
)
),
flex(),
hbox(
text(L"south-west"),
flex(),
text(L"south-east")
)
);
auto screen = ftxui::Screen::WholeTerminal();
Render(screen, root.get());
std::cout << screen.ToString();
getchar();
return 0;
}