mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-20 02:28:10 +08:00
Add Blink. Refactor examples.
This commit is contained in:
36
examples/dom/vbox_hbox.cpp
Normal file
36
examples/dom/vbox_hbox.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "ftxui/screen.hpp"
|
||||
#include "ftxui/dom/elements.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
using namespace ftxui::dom;
|
||||
auto document =
|
||||
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::TerminalFullscreen();
|
||||
Render(screen, document.get());
|
||||
|
||||
std::cout << screen.ToString();
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user