Skip to content
You are viewing documentation for v6.1.8. 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_in_frame_horizontal, component/menu_style, component/menu_underline_animated_gallery

Summary ​

SymbolDescription
entries
selectedThe list of entries.
underlineThe index of the selected entry.
entries_option
direction
elements_prefix
elements_infix
elements_postfix
on_change
on_enterCalled when the selected entry changes.
focused_entryCalled when the user presses enter.

Public Attributes ​

entries ​

cpp
ConstStringListRef entries;

selected ​

cpp
Ref< int > selected = 0;

The list of entries.

underline ​

cpp
UnderlineOption underline;

The index of the selected entry.

entries_option ​

cpp
MenuEntryOption entries_option;

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.