Skip to content

Help about focusable object cycling #1048

Answered by ArthurSonzogni
lmarzull asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @lmarzull,

It looks like you are using the Renderer function improperly. Maybe you should directly create new ComponentBase object directly and override the OnRender function instead? That's more boilerplate, but it won't hide you any details.


The Renderer exist in two versions:

auto inner = [...]
 
auto renderer = Renderer(inner, [&] {
  return inner->Render() | border
});

and

auto renderer = Renderer([&]{ 
  return text("hello");
})

The first create a new Component, adds inner as a child, and defers all the behavior to the childs, except for OnRender that is using the specified function.

The Component Tree looks like:

┌────────┐
│renderer│
└┬───────┘
┌▽────┐   
│inner│   
└─────┘   …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lmarzull
Comment options

Answer selected by lmarzull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants