diff --git a/benchmark/benches/size_probe_benchmark.rs b/benchmark/benches/size_probe_benchmark.rs index 04ffe007..37f80088 100644 --- a/benchmark/benches/size_probe_benchmark.rs +++ b/benchmark/benches/size_probe_benchmark.rs @@ -46,7 +46,7 @@ impl ObjectImpl for TestWidget {} impl WidgetImpl for TestWidget {} impl TestWidget { - pub fn new() -> Box { - Object::new(&[]) + pub fn new() -> Tr { + Self::new_alloc() } } diff --git a/examples/async_task/async_task_widget.rs b/examples/async_task/async_task_widget.rs index 90ae9287..9addb6cf 100644 --- a/examples/async_task/async_task_widget.rs +++ b/examples/async_task/async_task_widget.rs @@ -89,7 +89,7 @@ impl WidgetImpl for AsyncTaskWidget {} impl AsyncTaskWidget { #[inline] - pub fn new() -> Box { - Object::new(&[]) + pub fn new() -> Tr { + Self::new_alloc() } } diff --git a/examples/border/main.rs b/examples/border/main.rs index a8f09157..f2508854 100644 --- a/examples/border/main.rs +++ b/examples/border/main.rs @@ -16,8 +16,8 @@ fn main() { fn build_ui(window: &mut ApplicationWindow) { let mut hbox = HBox::new(); - let mut widget1: Box = Object::new(&[]); - let mut widget2: Box = Object::new(&[]); + let mut widget1 = Widget::new_alloc(); + let mut widget2 = Widget::new_alloc(); widget1.set_background(Color::CYAN); widget1.width_request(400); diff --git a/examples/box_layout/hbox_layout.rs b/examples/box_layout/hbox_layout.rs index 60a684e1..84528f5d 100644 --- a/examples/box_layout/hbox_layout.rs +++ b/examples/box_layout/hbox_layout.rs @@ -6,13 +6,13 @@ use tmui::{label::Label, prelude::*}; #[derive(Childrenable)] pub struct HBoxLayout { #[children] - label_1: Box