1786031096

This commit is contained in:
2026-08-06 17:44:56 +02:00
parent 4b30c6b4f6
commit df144ea487
2 changed files with 27 additions and 128 deletions

View File

@@ -1,3 +1,8 @@
use std::{
thread::{self, sleep},
time::Duration,
};
mod rgba;
#[cfg(not(feature = "dev"))]
mod trekstor;
@@ -9,13 +14,16 @@ fn main() -> Result<(), slint::PlatformError> {
slint::platform::set_platform(Box::new(crate::trekstor::Trekstor::new()))
.expect("set platform");
let ui = MainWindow::new()?;
let main_window = MainWindow::new()?;
// let ui_handle = ui.as_weak();
// ui.on_request_increase_value(move || {
// let ui = ui_handle.unwrap();
// ui.set_counter(ui.get_counter() + 1);
// });
let weak_window = main_window.as_weak();
thread::spawn(move || {
sleep(Duration::from_secs(3));
println!("Goodbye!");
weak_window.upgrade_in_event_loop(move |ui| {
ui.set_text("GoodBye!".into());
})
});
ui.run()
main_window.run()
}