#include <string>
return vbox({
text("FTXUI : Une bibliothèque puissante pour construire des interfaces utilisateur."),
text("Profitez d'un riche ensemble de composants et d'un style déclaratif."),
text("Créez des interfaces utilisateur belles et réactives avec un minimum d'effort."),
text("Rejoignez la communauté et découvrez la puissance de FTXUI."),
});
}
auto screen = ScreenInteractive::TerminalOutput();
auto quit =
Button(
"Quitter",
screen.ExitLoopClosure(), ButtonOption::Animated());
int selection_change_counter = 0;
std::string selection_content = "";
selection_change_counter++;
selection_content =
screen.GetSelection();
});
auto renderer = Renderer(quit, [&] {
return vbox({
text("Sélection changée : " + std::to_string(selection_change_counter) +
" fois"),
text("Actuellement sélectionné : "),
paragraph(selection_content) | vscroll_indicator | frame | border |
size(HEIGHT, EQUAL, 10),
window(text("Séparation horizontale"), hbox({
separator(),
separator(),
})),
window(text("Séparation verticale"), vbox({
separator(),
separator(),
})),
window(text("Séparation en grille avec un style différent"),
vbox({
hbox({
separator(),
| selectionBackgroundColor(Color::Yellow)
| selectionColor(Color::Black)
| selectionStyleReset,
separator(),
}),
separator(),
hbox({
separator(),
}),
separator(),
}),
})),
quit->Render(),
});
});
}
Un caractère Unicode et son style associé.
L'espace de noms FTXUI ftxui::
std::shared_ptr< Node > Element