Open MarcelFerrari opened 3 months ago
Hi, If you want to use loop function for Component, you can try this
...
auto screen = ScreenInteractive::FitComponent();
auto frame = Renderer([=](bool focused){
return window(text("Example UI"), text("Hello, World!"), LIGHT);
});
screen.Loop(frame);
...
If you just want to show a element, you can try this
...
auto document = window(text("Example UI"), text("Hello, World!"), LIGHT);
auto screen = Screen::Create(
Dimension::Full(),
Dimension::Fit(document);
);
screen.Print();
...
hope this can help you . And I advise you to check examples. There are many method of application of dom or component
Oh, If you want to use Component "Window", not dom "window" you can check example "https://github.com/ArthurSonzogni/FTXUI/blob/main/examples/component/window.cpp"
finally...
if you want to use Renderer()
there are two kinds of override function
first is like Renderer([=](bool focused){ return text("ok"); });
second is like
auto example = Button("ok", []{});
Renderer(example, [=]{ return example->Render() | color(Color::Black); });
Hi all,
I am trying to create a window element with a light border style similarly to what is specified here.
Example:
My code looks like this:
But it fails to compile with the following error:
It seems like there is no definition for
window(Element, Element, BorderStyle)
after all.This is confirmed when looking into
ftxui/dom/elements.hpp
:Although if wee look at
border.cpp
we do find the function:Is it just missing from
elements.hpp
? What is the recommended way to create windows with different border styles without modifying the FTXUI source code or including extra files for this?Many thanks in advance,
Marcel