16 std::vector<std::string> entries;
19 for (
int i = 0; i < 30; ++i) {
20 entries.push_back(
"RadioBox " + std::to_string(i));
22 auto radiobox =
Radiobox(&entries, &selected);
24 return radiobox->Render() | vscroll_indicator | frame |
static ScreenInteractive FitComponent()
创建一个 ScreenInteractive,其宽度和高度与正在绘制的组件匹配。
Component Radiobox(RadioboxOption 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