mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-23 13:28:08 +08:00
Animation (#355)
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
#include "ftxui/component/captured_mouse.hpp" // for ftxui
|
||||
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
|
||||
#include "ftxui/component/component_base.hpp" // for ComponentBase
|
||||
#include "ftxui/component/component_options.hpp" // for ButtonOption
|
||||
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
|
||||
#include "ftxui/dom/elements.hpp" // for text, separator, Element, operator|, vbox, border
|
||||
|
||||
@@ -13,24 +12,17 @@ using namespace ftxui;
|
||||
// An example of how to compose multiple components into one and maintain their
|
||||
// interactiveness.
|
||||
int main(int argc, const char* argv[]) {
|
||||
auto button_option = ButtonOption();
|
||||
button_option.border = false;
|
||||
|
||||
auto left_count = 0;
|
||||
auto right_count = 0;
|
||||
|
||||
auto left_buttons = Container::Horizontal({
|
||||
Button(
|
||||
"[Decrease]", [&] { left_count--; }, &button_option),
|
||||
Button(
|
||||
"[Increase]", [&] { left_count++; }, &button_option),
|
||||
Button("Decrease", [&] { left_count--; }),
|
||||
Button("Increase", [&] { left_count++; }),
|
||||
});
|
||||
|
||||
auto right_buttons = Container::Horizontal({
|
||||
Button(
|
||||
"[Decrease]", [&] { right_count--; }, &button_option),
|
||||
Button(
|
||||
"[Increase]", [&] { right_count++; }, &button_option),
|
||||
Button("Decrease", [&] { right_count--; }),
|
||||
Button("Increase", [&] { right_count++; }),
|
||||
});
|
||||
|
||||
// Renderer decorates its child with a new rendering function. The way the
|
||||
|
Reference in New Issue
Block a user