21 MenuEntryOption option;
22 option.transform = [c](EntryState state) {
23 state.label = (state.active ?
"> " :
" ") + state.label;
37 auto screen = App::TerminalOutput();
40 auto menu = Container::Vertical(
73 hbox(
text(
"selected = "),
text(std::to_string(selected))),
80 screen.Loop(renderer);
82 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.
Decorator size(WidthOrHeight direction, Constraint constraint, int value)
Apply a constraint on the size of an element.
Element bold(Element child)
Use a bold font, for elements with more emphasis.
Element inverted(Element child)
Add a filter that will invert the foreground and the background colors.
Element separator()
Draw a vertical or horizontal separation in between two other elements.
Element color(Color color, Element child)
Set the foreground color of an element.
Element vbox(Elements children)
A container displaying elements vertically one by one.
The FTXUI ftxui:: namespace.
std::shared_ptr< Node > Element
Element hbox(Elements children)
A container displaying elements horizontally one by one.