Skip to content
You are viewing documentation for v4.1.0. Switch to latest (main).

ftxui::MenuOption ​

cpp
#include <ftxui/component/component_options.hpp>

Option for the Menu component.

Examples: component/homescreen, component/menu, component/menu2, component/menu_style, component/menu_underline_animated_gallery

Summary ​

SymbolDescription
underline
entries
direction
elements_prefix
elements_infix
elements_postfix
on_change
on_enterCalled when the selected entry changes.
focused_entryCalled when the user presses enter.
Horizontal
HorizontalAnimated
Vertical
VerticalAnimated
Toggle

Public Attributes ​

underline ​

cpp
UnderlineOption underline;

entries ​

cpp
MenuEntryOption entries;

direction ​

cpp
Direction direction = Direction::Down;

elements_prefix ​

cpp
std::function< Element()> elements_prefix;

elements_infix ​

cpp
std::function< Element()> elements_infix;

elements_postfix ​

cpp
std::function< Element()> elements_postfix;

on_change ​

cpp
std::function< void()> on_change;

on_enter ​

cpp
std::function< void()> on_enter;

Called when the selected entry changes.

Examples: component/menu

focused_entry ​

cpp
Ref< int > focused_entry = 0;

Called when the user presses enter.

Static Functions ​

Horizontal ​

cpp
static MenuOption Horizontal();

Examples: component/button, component/button_animated, component/button_style, component/canvas_animated, component/composition, component/dropdown, component/flexbox_gallery, component/homescreen, component/menu2, component/menu_multiple, component/menu_style, component/modal_dialog_custom (+3 more)

HorizontalAnimated ​

Vertical ​

cpp
static MenuOption Vertical();

Examples: component/button_in_frame, component/button_style, component/checkbox, component/checkbox_in_frame, component/collapsible, component/dropdown, component/flexbox_gallery, component/focus, component/focus_cursor, component/gallery, component/homescreen, component/input (+13 more)

VerticalAnimated ​

Toggle ​

cpp
static MenuOption Toggle();

Examples: component/gallery, component/menu_style, component/tab_horizontal, component/toggle