Figured out that I don't need a special screen, just send events to the component directly with OnEvent. However, you have to component->Add() or call Render(component, []) with it or else it's not considered a child.
This commit is contained in:
parent
e3cff8142c
commit
96ee16e598
9 changed files with 32 additions and 1078 deletions
10
panel.cpp
10
panel.cpp
|
@ -2,12 +2,16 @@
|
|||
|
||||
void Panel::resize(int width, int height) {
|
||||
$dirty = true;
|
||||
// $screen = ScreenInteractive::FixedSize(width, height);
|
||||
$screen = Screen(width, height);
|
||||
}
|
||||
|
||||
void Panel::set_renderer(std::function< Element()> render) {
|
||||
void Panel::set_renderer(Component renderer) {
|
||||
$dirty = true;
|
||||
$component = Renderer(render);
|
||||
$component = renderer;
|
||||
}
|
||||
|
||||
void Panel::add(Component child) {
|
||||
$component->Add(child);
|
||||
}
|
||||
|
||||
void Panel::render() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue