Skip to content
You are viewing documentation for v0.10. Switch to latest (main).

ftxui::MenuOption ​

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

Option for the Menu component.

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

Summary ​

SymbolDescription
style_normalstyle.
style_focusedStyle when focused.
style_selectedStyle when selected.
style_selected_focusedStyle when selected and focused.
on_changeCalled when the selected entry changes.
on_enterCalled when the user presses enter.
focused_entry

Public Attributes ​

style_normal ​

cpp
Decorator style_normal = nothing;

style.

Examples: component/menu_style

style_focused ​

cpp
Decorator style_focused = inverted;

Style when focused.

Examples: component/menu_style

style_selected ​

cpp
Decorator style_selected = bold;

Style when selected.

Examples: component/menu_style

style_selected_focused ​

cpp
Decorator style_selected_focused =
      Decorator(inverted) | bold;

Style when selected and focused.

Examples: component/menu_style

on_change ​

cpp
std::function< void()> on_change = [] {};

Called when the selected entry changes.

on_enter ​

cpp
std::function< void()> on_enter = [] {};

Called when the user presses enter.

Examples: component/menu, component/menu_style

focused_entry ​

cpp
Ref< int > focused_entry = 0;