1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

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 09:22:46 +03:00
committed by GitHub
parent e0c7533ede
commit ebc4fc866d
8 changed files with 80 additions and 1 deletions

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;