mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-23 13:28:08 +08:00
Update examples to use std::string. (#182)
In examples and tests, use std::string. In addtion: 1. Address follow-up from: https://github.com/ArthurSonzogni/FTXUI/pull/179 2. Fix a bug when Input is used with std::string.
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
#include <memory> // for __shared_ptr_access, allocator_traits<>::value_type, shared_ptr
|
||||
#include <string> // for operator+
|
||||
#include <memory> // for shared_ptr, __shared_ptr_access, allocator_traits<>::value_type
|
||||
#include <string> // for operator+, to_string
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
|
||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||
#include "ftxui/dom/elements.hpp" // for Element, operator|, size, border, frame, HEIGHT, LESS_THAN
|
||||
#include "ftxui/screen/string.hpp" // for to_wstring
|
||||
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
|
||||
|
||||
using namespace ftxui;
|
||||
|
||||
@@ -21,7 +20,8 @@ int main(int argc, const char* argv[]) {
|
||||
auto container = Container::Vertical({});
|
||||
for (int i = 0; i < size; ++i) {
|
||||
states[i].checked = false;
|
||||
container->Add(Checkbox(L"Checkbox" + to_wstring(i), &states[i].checked));
|
||||
container->Add(
|
||||
Checkbox("Checkbox" + std::to_string(i), &states[i].checked));
|
||||
}
|
||||
|
||||
auto component = Renderer(container, [&] {
|
||||
|
Reference in New Issue
Block a user