mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
add widget dynamic helper and Split::up
This commit is contained in:
parent
038451e2f4
commit
97af45b576
4 changed files with 47 additions and 17 deletions
|
|
@ -42,6 +42,10 @@ pub trait Output<E: Engine> {
|
|||
/// Render widget in area
|
||||
fn render_in (&mut self, area: E::Area, widget: &dyn Widget<Engine = E>) -> Usually<()>;
|
||||
}
|
||||
/// Cast to dynamic pointer
|
||||
pub fn widget <E: Engine, T: Widget<Engine = E>> (w: &T) -> &dyn Widget<Engine = E> {
|
||||
w as &dyn Widget<Engine = E>
|
||||
}
|
||||
/// A renderable component
|
||||
pub trait Widget: Send + Sync {
|
||||
/// Engine for which this component is implemented
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue