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()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
Component MenuEntry(ConstStringRef label, MenuEntryOption options={})
A specific menu entry. They can be put into a Container::Vertical to form a menu.
Element text(std::string_view text)
Display a piece of UTF8 encoded unicode text.
Element bgcolor(Color color, Element child)
Set the background color of an element.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element vbox(Elements children)
A container displaying elements vertically one by one.
The FTXUI ftxui:: namespace.
Element hbox(Elements children)
A container displaying elements horizontally one by one.
Element frame(Element child)
Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....