1786031096
This commit is contained in:
22
src/main.rs
22
src/main.rs
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user