use gtk::prelude::GtkWindowExt; use relm4::{gtk, ComponentParts, ComponentSender, SimpleComponent}; #[derive(Default)] struct AppModel; #[relm4_macros::component] impl SimpleComponent for AppModel { type Init = (); type Input = (); type Output = (); view! { gtk::Window { set_title: Some("Simple app"), set_default_width: 300, set_default_height: 100, #[local_ref] my_box_ref -> gtk::Box { gtk::Label { set_label: "This should compile", } }, } } fn init( _init: Self::Init, _root: Self::Root, _sender: ComponentSender, ) -> ComponentParts { let model = Self; let my_box = gtk::Box::default(); let my_box_ref = &my_box; let widgets = view_output!(); ComponentParts { model, widgets } } fn update(&mut self, _msg: (), _sender: ComponentSender) {} }