1786043294
This commit is contained in:
@@ -15,10 +15,8 @@ fn main() -> Result<(), slint::PlatformError> {
|
|||||||
|
|
||||||
let weak_window = main_window.as_weak();
|
let weak_window = main_window.as_weak();
|
||||||
slint::spawn_local(async move {
|
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));
|
sleep(Duration::from_secs(5));
|
||||||
|
weak_window.upgrade_in_event_loop(move |ui| {
|
||||||
println!("Goodbye!");
|
println!("Goodbye!");
|
||||||
ui.set_text("GoodBye!".into());
|
ui.set_text("GoodBye!".into());
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -118,16 +118,6 @@ impl Platform for Trekstor {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
let pending: Vec<_> = self
|
|
||||||
.queue
|
|
||||||
.lock()
|
|
||||||
.expect("event loop closure queue poisoned")
|
|
||||||
.drain(..)
|
|
||||||
.collect();
|
|
||||||
for c in pending {
|
|
||||||
c();
|
|
||||||
}
|
|
||||||
|
|
||||||
if self.quit_flag.load(Ordering::SeqCst) {
|
if self.quit_flag.load(Ordering::SeqCst) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -148,6 +138,16 @@ impl Platform for Trekstor {
|
|||||||
});
|
});
|
||||||
|
|
||||||
ctx.input.finish();
|
ctx.input.finish();
|
||||||
|
|
||||||
|
let pending: Vec<_> = self
|
||||||
|
.queue
|
||||||
|
.lock()
|
||||||
|
.expect("event loop closure queue poisoned")
|
||||||
|
.drain(..)
|
||||||
|
.collect();
|
||||||
|
for c in pending {
|
||||||
|
c();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user