1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -04:00

Box the app creator (#1373)

This commit is contained in:
Emil Ernerfeldt
2022-03-18 14:23:07 +01:00
committed by GitHub
parent c8f6cae362
commit c69f39e869
12 changed files with 46 additions and 23 deletions

View File

@@ -19,5 +19,8 @@ pub fn start(canvas_id: &str) -> Result<(), wasm_bindgen::JsValue> {
// Redirect tracing to console.log and friends:
tracing_wasm::set_as_global_default();
eframe::start_web(canvas_id, |cc| Box::new(egui_demo_lib::WrapApp::new(cc)))
eframe::start_web(
canvas_id,
Box::new(|cc| Box::new(egui_demo_lib::WrapApp::new(cc))),
)
}

View File

@@ -16,7 +16,9 @@ fn main() {
drag_and_drop_support: true,
..Default::default()
};
eframe::run_native("egui demo app", options, |cc| {
Box::new(egui_demo_lib::WrapApp::new(cc))
});
eframe::run_native(
"egui demo app",
options,
Box::new(|cc| Box::new(egui_demo_lib::WrapApp::new(cc))),
);
}