19 std::function<
void()> exit) {
20 auto component = Container::Vertical({
27 text(
"Main component"),
41 std::function<
void()> hide_modal) {
42 auto component = Container::Vertical({
49 text(
"Modal component "),
59int main(
int argc,
const char* argv[]) {
63 bool modal_shown =
false;
66 auto show_modal = [&] { modal_shown =
true; };
67 auto hide_modal = [&] { modal_shown =
false; };
68 auto exit =
screen.ExitLoopClosure();
69 auto do_nothing = [&] {};
77 main_component |=
Modal(modal_component, &modal_shown);
79 screen.Loop(main_component);
static ScreenInteractive TerminalOutput()
static ButtonOption Animated()
Component Button(ButtonOption options)
Dibuja un botón. Ejecuta una función al hacer clic.
Component Modal(Component main, Component modal, const bool *show_modal)
Component Renderer(Component child, std::function< Element()>)
Retorna un nuevo Componente, similar a |child|, pero usando |render| como el evento Component::Render...
Decorator size(WidthOrHeight, Constraint, int value)
Aplica una restricción al tamaño de un elemento.
Element center(Element)
Centra un elemento horizontal y verticalmente.
Element text(std::wstring text)
Muestra un fragmento de texto Unicode.
Element separator()
Dibuja una separación vertical u horizontal entre otros dos elementos.
Element border(Element)
Draw a border around the element.
Component ModalComponent(std::function< void()> do_nothing, std::function< void()> hide_modal)
Component MainComponent(std::function< void()> show_modal, std::function< void()> exit)
El espacio de nombres ftxui:: de FTXUI.
std::shared_ptr< Node > Element
std::shared_ptr< ComponentBase > Component