eframe web: access app from WebHandle (#1886)

Co-authored-by: Stanislav <enomado@users.noreply.github.com>
Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
Stanislav
2022-09-09 08:22:46 +02:00
committed by GitHub
co-authored by Stanislav Emil Ernerfeldt
parent e0c7533ede
commit ebc4fc866d
8 changed files with 80 additions and 1 deletions
+5
View File
@@ -265,6 +265,11 @@ impl AppRunner {
&self.egui_ctx
}
/// Get mutable access to the concrete [`App`] we enclose.
pub fn app_mut<ConreteApp: 'static + crate::App>(&mut self) -> &mut ConreteApp {
self.app.as_any_mut().downcast_mut::<ConreteApp>().unwrap()
}
pub fn auto_save(&mut self) {
let now = now_sec();
let time_since_last_save = now - self.last_save_time;