21 auto buttons = Container::Horizontal({
31 auto component =
Renderer(buttons, [&] {
34 text(
"value = " + std::to_string(value)),
43 screen.Loop(component);
static ButtonOption Animated()
创建一个使用动画颜色的ButtonOption。
static ScreenInteractive FitComponent()
创建一个 ScreenInteractive,其宽度和高度与正在绘制的组件匹配。
Component Button(ButtonOption options)
绘制一个按钮。点击时执行一个函数。
Component Renderer(Component child, std::function< Element()>)
返回一个新组件,类似于 |child|,但使用 |render| 作为 Component::Render() 事件。
virtual void Render(Screen &screen)
在 ftxui::Screen 上显示元素。
Element text(std::wstring text)
显示一段Unicode文本。
Element separator()
在两个其他元素之间绘制垂直或水平分隔线。
Element vbox(Elements)
垂直一个接一个显示元素的容器。
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase
Element gauge(float progress)
绘制一个高清进度条。