pub trait Widget: DynClone + SupportsInterfaces {
// Required methods
fn new(&self) -> Box<dyn WidgetData>;
fn clone_data(
&self,
tree: &mut WindowTree<'_>,
source: Window,
dest: Window,
clone_window: Box<dyn Fn(&WindowTree<'_>, Window) -> Window>
);
fn render(
&self,
tree: &WindowTree<'_>,
window: Window,
rp: &mut RenderPort,
app: &mut dyn App
);
fn measure(
&self,
tree: &mut WindowTree<'_>,
window: Window,
available_width: Option<i16>,
available_height: Option<i16>,
app: &mut dyn App
) -> Vector;
fn arrange(
&self,
tree: &mut WindowTree<'_>,
window: Window,
final_inner_bounds: Rect,
app: &mut dyn App
) -> Vector;
fn update(
&self,
tree: &mut WindowTree<'_>,
window: Window,
event: Event,
event_source: Window,
app: &mut dyn App
) -> bool;
// Provided methods
fn secondary_focusable(&self) -> bool { ... }
fn pre_process(&self) -> bool { ... }
fn post_process(&self) -> bool { ... }
fn bring_into_view(
&self,
_tree: &mut WindowTree<'_>,
_window: Window,
_rect: Rect
) -> bool { ... }
}