FTXUI 6.1.9
C++ functional terminal UI.
载入中...
搜索中...
未找到
examples/component/radiobox.cpp
浏览该文件的文档.
1// Copyright 2020 Arthur Sonzogni. 版权所有。
2// 本源代码的使用受 MIT 许可协议的约束,该协议可在 LICENSE 文件中找到。
3#include <string> // for string, allocator, basic_string
4#include <vector> // for vector
5
6#include "ftxui/component/captured_mouse.hpp" // for ftxui
7#include "ftxui/component/component.hpp" // for Radiobox
8#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
9
10using namespace ftxui;
11
12int main() {
13 std::vector<std::string> radiobox_list = {
14 "Use gcc",
15 "Use clang",
16 "Use emscripten",
17 "Use tcc",
18 };
19 int selected = 0;
20
22 screen.Loop(Radiobox(&radiobox_list, &selected));
23 return 0;
24}
static ScreenInteractive TerminalOutput()
Component Radiobox(RadioboxOption options)
元素列表,其中只能选择一个。
#include "ftxui/component/component_base.hpp" // 用于 ComponentBase