17 std::array<bool, 30> states;
19 auto container = Container::Vertical({});
20 for (
int i = 0; i < 30; ++i) {
22 container->Add(
Checkbox(
"Checkbox" + std::to_string(i), &states[i]));
26 return container->Render() | vscroll_indicator | frame |
static ScreenInteractive FitComponent()
创建一个 ScreenInteractive,其宽度和高度与正在绘制的组件匹配。
Component Renderer(Component child, std::function< Element()>)
返回一个新组件,类似于 |child|,但使用 |render| 作为 Component::Render() 事件。
Component Checkbox(CheckboxOption options)
绘制可勾选元素。
Decorator size(WidthOrHeight, Constraint, int value)
对元素大小应用约束。
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase