16 std::vector<std::string> entries;
19 for (
int i = 0; i < 30; ++i) {
20 entries.push_back(
"Entry " + std::to_string(i));
22 auto radiobox =
Menu(&entries, &selected);
24 return radiobox->Render() | vscroll_indicator | frame |
static ScreenInteractive FitComponent()
创建一个 ScreenInteractive,其宽度和高度与正在绘制的组件匹配。
Component Menu(MenuOption options)
文本列表。選定的元素是焦點。
Component Renderer(Component child, std::function< Element()>)
返回一个新组件,类似于 |child|,但使用 |render| 作为 Component::Render() 事件。
Decorator size(WidthOrHeight, Constraint, int value)
对元素大小应用约束。
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase