mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 13:50:04 -04:00
Graceful exit from web (#1650)
Return a handle that can be used to stop a running egui instance.
This commit is contained in:
@@ -33,6 +33,8 @@
|
||||
overflow: hidden;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Position canvas in center-top: */
|
||||
@@ -131,7 +133,11 @@
|
||||
console.debug("wasm loaded. starting app…");
|
||||
|
||||
// This call installs a bunch of callbacks and then returns:
|
||||
wasm_bindgen.start("the_canvas_id");
|
||||
const handle = wasm_bindgen.start("the_canvas_id");
|
||||
|
||||
// call `handle.stop_web()` to stop
|
||||
// uncomment to quick result
|
||||
// setTimeout(() => {handle.stop_web(); handle.free())}, 2000)
|
||||
|
||||
console.debug("app started.");
|
||||
document.getElementById("center_text").remove();
|
||||
|
||||
Reference in New Issue
Block a user