16 std::vector<std::string> entries;
19 for (
int i = 0; i < 100; ++i) {
20 entries.push_back(std::to_string(i));
24 radiobox, [&] {
return radiobox->Render() | hscroll_indicator |
frame; });
static ScreenInteractive FitComponent()
创建一个 ScreenInteractive,其宽度和高度与正在绘制的组件匹配。
static MenuOption Horizontal()
水平菜单的标准选项。 这对于实现选项卡栏非常有用。
Component Menu(MenuOption options)
文本列表。選定的元素是焦點。
Component Renderer(Component child, std::function< Element()>)
返回一个新组件,类似于 |child|,但使用 |render| 作为 Component::Render() 事件。
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase
Element frame(Element)
允许元素显示在“虚拟”区域内。其大小可以 大于其容器。在这种情况下,只显示较小的部分。 视图是可滚动的,以使获得焦点的元素可见。