#include <chrono>
#include <iostream>
#include <string>
#include <thread>
int main() {
using namespace std::chrono_literals;
std::string reset_position;
for (float percentage = 0.0f; percentage <= 1.0f; percentage += 0.002f) {
std::string data_downloaded =
text(
" " + data_downloaded),
});
auto screen = Screen(100, 1);
std::cout << reset_position;
screen.Print();
reset_position = screen.ResetPosition();
std::this_thread::sleep_for(0.01s);
}
std::cout << std::endl;
}
Element flex(Element)
Make a child element to expand proportionally to the space left in a container.
Element hbox(Elements)
A container displaying elements horizontally one by one.
std::string to_string(const std::wstring &s)
Convert a UTF8 std::string into a std::wstring.
Element text(std::wstring text)
Display a piece of unicode text.
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Element gauge(float progress)
Draw a high definition progress bar.