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:
Zed A. Shaw 2024-11-14 12:37:31 -05:00
parent e3cff8142c
commit 96ee16e598
9 changed files with 32 additions and 1078 deletions

View file

@ -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() {