20 MenuEntryOption option;
21 option.animated_colors.foreground.enabled =
true;
22 option.animated_colors.background.enabled =
true;
23 option.animated_colors.background.active = c;
24 option.animated_colors.background.inactive = Color::Black;
25 option.animated_colors.foreground.active = Color::White;
26 option.animated_colors.foreground.inactive = c;
31 auto screen = App::TerminalOutput();
34 auto menu = Container::Vertical(
55 hbox(
text(
"selected = "),
text(std::to_string(selected))),
57 menu->Render() |
frame,
62 screen.Loop(renderer);
64 std::cout <<
"Selected element = " << selected << std::endl;
Component Renderer(Component child, std::function< Element()>)
Retourne un nouveau Component, similaire à |child|, mais utilisant |render| comme événement Component...
Component MenuEntry(ConstStringRef label, MenuEntryOption options={})
Une entrée de menu spécifique. Elles peuvent être placées dans un Container::Vertical pour former un ...
Element text(std::string_view text)
Affiche un morceau de texte unicode encodé en UTF8.
Element bgcolor(Color color, Element child)
Définit la couleur d'arrière-plan d'un élément.
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::
Element hbox(Elements children)
Un conteneur affichant les éléments horizontalement un par un.
Element frame(Element child)
Permet à un élément d'être affiché dans une zone 'virtuelle'. Sa taille peut être plus grande que son...