Box widgets

This way, widgets containing other widgets can be heterogenous. Wenever
a widget is expeted, *any* widget will work.
This commit is contained in:
Joscha 2022-07-12 21:09:38 +02:00
parent dea0384162
commit 8eda1ad97d
5 changed files with 5 additions and 5 deletions

View file

@ -8,5 +8,5 @@ use toss::frame::{Frame, Pos, Size};
pub trait Widget {
fn size(&self, frame: &mut Frame, max_width: Option<u16>, max_height: Option<u16>) -> Size;
async fn render(self, frame: &mut Frame, pos: Pos, size: Size);
async fn render(self: Box<Self>, frame: &mut Frame, pos: Pos, size: Size);
}