1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 21:00:03 -04:00

Simplify interface

This commit is contained in:
Emil Ernerfeldt
2022-08-20 10:04:12 +02:00
parent d3e26cd00a
commit ba9d1e446c
2 changed files with 6 additions and 18 deletions

View File

@@ -35,7 +35,7 @@ impl WebInput {
// ----------------------------------------------------------------------------
use std::{any::Any, sync::atomic::Ordering::SeqCst};
use std::sync::atomic::Ordering::SeqCst;
/// Stores when to do the next repaint.
pub struct NeedRepaint(Mutex<f64>);
@@ -265,8 +265,9 @@ impl AppRunner {
&self.egui_ctx
}
pub fn get_app_mut(&mut self) -> &mut dyn Any {
self.app.as_any_mut()
/// 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) {