16 auto screen = App::FitComponent();
17 auto back_button =
Button(
"Back", screen.ExitLoopClosure());
18 auto goto_1 =
Button(
"Goto /1", [path] {
Nested(path +
"/1"); });
19 auto goto_2 =
Button(
"Goto /2", [path] {
Nested(path +
"/2"); });
20 auto goto_3 =
Button(
"Goto /3", [path] {
Nested(path +
"/3"); });
21 auto layout = Container::Vertical({
27 auto renderer =
Renderer(layout, [&] {
29 text(
"path: " + path),
31 back_button->Render(),
38 screen.Loop(renderer);
42 auto screen = App::FitComponent();
43 auto button_quit =
Button(
"Quit", screen.ExitLoopClosure());
44 auto button_nested =
Button(
"Nested", [] {
Nested(
""); });
45 screen.Loop(Container::Vertical({
Component Button(ConstStringRef label, std::function< void()> on_click, ButtonOption options=ButtonOption::Simple())
Dessine un bouton. Exécute une fonction lorsqu'il est cliqué.
Component Renderer(Component child, std::function< Element()>)
Retourne un nouveau Component, similaire à |child|, mais utilisant |render| comme événement Component...
Element text(std::string_view text)
Affiche un morceau de texte unicode encodé en UTF8.
Element separator()
Dessine une séparation verticale ou horizontale entre deux autres éléments.
Element vbox(Elements children)
Un conteneur affichant les éléments verticalement un par un.
L'espace de noms FTXUI ftxui::
void Nested(std::string path)