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:
parent
dea0384162
commit
8eda1ad97d
5 changed files with 5 additions and 5 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue