1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 14:50:03 -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

@@ -1,6 +1,9 @@
use egui_extras::RetainedImage;
use poll_promise::Promise;
#[cfg(target_arch = "wasm32")]
use core::any::Any;
struct Resource {
/// HTTP response
response: ehttp::Response,
@@ -106,6 +109,11 @@ impl eframe::App for HttpApp {
}
});
}
#[cfg(target_arch = "wasm32")]
fn as_any_mut(&mut self) -> &mut dyn Any {
&mut *self
}
}
fn ui_url(ui: &mut egui::Ui, frame: &mut eframe::Frame, url: &mut String) -> bool {