use std::{thread::sleep, time::Duration}; mod rgba; #[cfg(not(feature = "dev"))] mod trekstor; slint::include_modules!(); fn main() -> Result<(), slint::PlatformError> { #[cfg(not(feature = "dev"))] slint::platform::set_platform(Box::new(crate::trekstor::Trekstor::new())) .expect("set platform"); let main_window = MainWindow::new()?; let weak_window = main_window.as_weak(); slint::spawn_local(async move { weak_window.upgrade_in_event_loop(move |ui| { println!("Hello!"); ui.set_text("Hello!".into()); sleep(Duration::from_secs(5)); println!("Goodbye!"); ui.set_text("GoodBye!".into()); }) }) .unwrap(); main_window.run() }