### Run Confirmation Dialog Example Source: https://github.com/emilk/egui/blob/main/examples/confirm_exit/README.md This command builds and runs the confirmation dialog example from the egui project. Ensure you have cargo installed and are in the correct project directory. ```sh cargo run -p confirm_exit ``` -------------------------------- ### Run File Dialog Example Source: https://github.com/emilk/egui/blob/main/examples/file_dialog/README.md This command builds and runs the file dialog example from the egui project. Ensure you have the egui project cloned and Cargo installed. ```shell cargo run -p file_dialog ``` -------------------------------- ### Run Parallel Hello World Example Source: https://github.com/emilk/egui/blob/main/examples/hello_world_par/README.md Execute the parallel hello world example using cargo. This command builds and runs the example located in the 'hello_world_par' package. ```sh cargo run -p hello_world_par ``` -------------------------------- ### Run Custom Keypad Example Source: https://github.com/emilk/egui/blob/main/examples/custom_keypad/README.md Execute the custom keypad example using Cargo. This command builds and runs the example project located at examples/custom_keypad. ```sh cargo run -p custom_keypad ``` -------------------------------- ### Run Hello World Example Source: https://github.com/emilk/egui/blob/main/examples/hello_world/README.md This command executes the hello_world example project using Cargo. Ensure you are in the project directory. ```sh cargo run -p hello_world ``` -------------------------------- ### Run egui_glow Example with Winit Source: https://github.com/emilk/egui/blob/main/crates/egui_glow/README.md To test the 'pure_glow' example, run this command. It enables the 'winit' feature and default fonts for egui. ```sh cargo run -p egui_glow --example pure_glow --features=winit,egui/default_fonts ``` -------------------------------- ### Build and Run on Desktop Source: https://github.com/emilk/egui/blob/main/examples/hello_android/README.md Use 'cargo run' to build and run the 'hello_android' example on the desktop. ```sh cargo run -p hello_android ``` -------------------------------- ### Run External Eventloop Async Example Source: https://github.com/emilk/egui/blob/main/examples/external_eventloop_async/README.md Build and run the external eventloop async example with the 'linux-example' feature enabled. ```sh cargo run -p external_eventloop_async --features linux-example ``` -------------------------------- ### Run User Attention Example Source: https://github.com/emilk/egui/blob/main/examples/user_attention/README.md This command builds and runs the user attention example from the egui project. ```sh cargo run -p user_attention ``` -------------------------------- ### Run External Eventloop Example Source: https://github.com/emilk/egui/blob/main/examples/external_eventloop/README.md Build and run the external eventloop example using Cargo. ```sh cargo run -p external_eventloop ``` -------------------------------- ### Run Custom Window Frame Example Source: https://github.com/emilk/egui/blob/main/examples/custom_window_frame/README.md Execute this command in your terminal to build and run the custom window frame example. Ensure you have the egui project cloned and are in the correct directory. ```sh cargo run -p custom_window_frame ``` -------------------------------- ### Install Android Command Line Tools Source: https://github.com/emilk/egui/blob/main/examples/hello_android/README.md Download and install the Android command line tools. This is a prerequisite for managing SDK components. ```sh mkdir -p "${ANDROID_HOME}/cmdline-tools" curl -sLo /tmp/clt.zip https://dl.google.com/android/repository/commandlinetools-linux-14742923_latest.zip unzip -d "${ANDROID_HOME}" /tmp/clt.zip ``` -------------------------------- ### Install git-lfs in the repo Source: https://github.com/emilk/egui/blob/main/CONTRIBUTING.md Installs git-lfs and its associated git hooks within the current repository. Run this after installing the git-lfs binary. ```bash git lfs install ``` -------------------------------- ### Basic egui_kittest Usage Source: https://github.com/emilk/egui/blob/main/crates/egui_kittest/README.md Demonstrates how to use Harness to interact with UI elements, check their states, and perform actions like clicking. Includes setup with a simple app and assertions. ```rust use egui::accesskit::Toggled; use egui_kittest::{Harness, kittest::{Queryable, NodeT}}; let mut checked = false; let app = |ui: &mut egui::Ui| { ui.checkbox(&mut checked, "Check me!"); }; let mut harness = Harness::new_ui(app); let checkbox = harness.get_by_label("Check me!"); assert_eq!(checkbox.accesskit_node().toggled(), Some(Toggled::False)); checkbox.click(); harness.run(); let checkbox = harness.get_by_label("Check me!"); assert_eq!(checkbox.accesskit_node().toggled(), Some(Toggled::True)); // Shrink the window size to the smallest size possible harness.fit_contents(); // You can even render the ui and do image snapshot tests #[cfg(all(feature = "wgpu", feature = "snapshot"))] harness.snapshot("readme_example"); ``` -------------------------------- ### Run Multiple Viewports Example Source: https://github.com/emilk/egui/blob/main/examples/multiple_viewports/README.md Execute the multiple viewports example using Cargo. This command builds and runs the egui application that demonstrates multiple native window creation. ```sh cargo run -p multiple_viewports ``` -------------------------------- ### Install Dependencies for Linux Source: https://github.com/emilk/egui/blob/main/crates/egui_glow/README.md Before using egui_glow on Linux, ensure you have the required XCB and XKB development libraries installed. ```bash sudo apt-get install libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev ``` -------------------------------- ### Toggle Switch Widget Example Source: https://github.com/emilk/egui/blob/main/README.md Demonstrates how to implement a custom toggle switch widget in egui. This example shows the structure for creating extensible widgets. ```Rust use egui::Response; use egui::Ui; /// A toggle switch widget. #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct ToggleSwitch(pub bool); impl ToggleSwitch { pub fn ui(self, ui: &mut Ui) -> Response { let ToggleSwitch(checked) = self; // Make the widget checkable let mut response = ui.add_enabled_ui(true, |ui| { ui.horizontal(|ui| { let (id, mut rect) = ui.allocate_exact_size(egui::vec2(40.0, 20.0), egui::Sense::click()); let stroke = egui::Stroke::new(1.0, ui.visuals().text_color()); let mut shape = egui::Shape::Rect{ rect: rect.expand(stroke.width / 2.0), rounding: egui::Rounding::same(rect.height() / 2.0), fill: if checked { ui.visuals().selection.bg_fill } else { ui.visuals().window_fill }, stroke: stroke, }; let circle_x = egui::lerp((rect.left() + stroke.width)..(rect.right() - stroke.width), if checked { 1.0 } else { 0.0 }); let circle_y = rect.center().y; let circle_r = rect.height() / 2.0 - stroke.width; shape = egui::Shape::circle_stroke(egui::Pos2::new(circle_x, circle_y), circle_r, stroke); ui.painter().add(shape); response = ui.interact(id, rect, egui::Sense::click()); if response.clicked() { checked = !checked; } }); }); checked } } ``` -------------------------------- ### Build and Run on Android Source: https://github.com/emilk/egui/blob/main/examples/hello_android/README.md Use 'cargo-apk' to build and run the 'hello_android' example on an Android device or emulator. ```sh cargo apk run -p hello_android --lib ``` -------------------------------- ### Start Multiple egui Applications Source: https://github.com/emilk/egui/blob/main/web_demo/multiple_apps.html Once the WASM module is loaded, this function starts multiple egui applications, each attached to a specific canvas element. It returns promises that resolve when the applications are successfully started. ```javascript function on_wasm_loaded() { console.debug("Wasm loaded. Starting apps…"); const handle_one = new wasm_bindgen.WebHandle(); const handle_two = new wasm_bindgen.WebHandle(); Promise.all([ handle_one.start(document.getElementById("canvas_id_one")), handle_two.start(document.getElementById("canvas_id_two")), ]).then((handles) => { on_apps_started(handle_one, handle_two) }).catch(on_error); } ``` -------------------------------- ### Install cargo-apk Source: https://github.com/emilk/egui/blob/main/examples/hello_android/README.md Install the 'cargo-apk' tool, which is used to build and run Rust applications on Android. This installs a patched version to work around an upstream bug. ```sh cargo install --git https://github.com/parasyte/cargo-apk.git --rev 282639508eeed7d73f2e1eaeea042da2716436d5 cargo-apk ``` -------------------------------- ### Good Rust Code Style Example Source: https://github.com/emilk/egui/blob/main/CONTRIBUTING.md Demonstrates idiomatic Rust practices including docstrings, TODO comments with author attribution, and concise function definitions. ```rust /// The name of the thing. pub fn name(&self) -> &str { &self.name } fn foo(&self) { // TODO(emilk): this can be optimized } ``` -------------------------------- ### Handle Application Started Event Source: https://github.com/emilk/egui/blob/main/web_demo/index.html Callback function executed when the egui application has successfully started. It clears loading messages and focuses the canvas. ```javascript function on_app_started(handle) { console.debug("App started."); document.getElementById("center_text").innerHTML = ''; document.getElementById("the_canvas_id").focus(); } ``` -------------------------------- ### Install Android SDK Components Source: https://github.com/emilk/egui/blob/main/examples/hello_android/README.md Install required Android SDK components, including build tools, NDK, and platforms. SDK versions may need adjustment. ```sh sdkmanager --sdk_root="${ANDROID_HOME}" --install "build-tools;36.0.0" "ndk;29.0.14206865" "platforms;android-35" ``` -------------------------------- ### OpenGL Painter Example Source: https://github.com/emilk/egui/blob/main/README.md Illustrates how to render egui's triangle mesh using OpenGL via the `egui_glow` crate. This is part of the integration process for native applications. ```Rust impl egui_glow::glow::HasContext for Painter { fn context(&self) -> &egui_glow::glow::Context { self.glow.as_ref() } } impl egui_glow::Painter { // ... other methods ... pub fn paint_and_commit(&mut self, frame_size: (usize, usize), clear_color: Option<[f32; 4]>, frame: &mut eframe::glow::Framebuffer, // The texture that egui will paint into. texture: &mut egui_glow::glow::Texture, ) { // ... implementation details ... } } ``` -------------------------------- ### Start Puffin Profiler and Viewer Source: https://github.com/emilk/egui/blob/main/examples/puffin_profiler/README.md Commands to run the puffin profiler in the background and then launch the puffin viewer to connect to it. ```sh cargo run -p puffin_profiler & cargo install puffin_viewer puffin_viewer --url 127.0.0.1:8585 ``` -------------------------------- ### Install image loaders for egui Source: https://github.com/emilk/egui/blob/main/crates/egui_extras/README.md Call this function with your egui context to enable image loading capabilities provided by egui_extras. ```rust egui_extras::install_image_loaders(egui_ctx); ``` -------------------------------- ### Immediate Mode Button Interaction Source: https://github.com/emilk/egui/blob/main/README.md Demonstrates how to display a button and handle its click event within a single frame in egui. This is a core example of immediate mode GUI interaction. ```rust if ui.button("Save file").clicked() { save(file); } ``` -------------------------------- ### Handle WASM Loaded Event Source: https://github.com/emilk/egui/blob/main/web_demo/index.html Callback function executed when the WebAssembly module is successfully loaded. It creates a WebHandle and starts the egui application. ```javascript function on_wasm_loaded() { console.debug("Wasm loaded. Starting app…"); let handle = new wasm_bindgen.WebHandle(); function check_for_panic() { if (handle.has_panicked()) { console.error("The egui app has crashed"); document.getElementById("the_canvas_id").remove(); document.getElementById("center_text").innerHTML = `

The egui app has crashed.

${handle.panic_message()}

See the console for details.

Reload the page to try again.

`; } else { let delay_ms = 1000; setTimeout(check_for_panic, delay_ms); } } check_for_panic(); handle.start(document.getElementById("the_canvas_id")).then(on_app_started).catch(on_error); } ``` -------------------------------- ### Bad Rust Code Style Example Source: https://github.com/emilk/egui/blob/main/CONTRIBUTING.md Illustrates common anti-patterns in Rust code, such as informal comments, using FIXME instead of TODO, and less descriptive function names. ```rust //gets the name pub fn get_name(&self) -> &str { &self.name } fn foo(&self) { //FIXME: this can be optimized } ``` -------------------------------- ### Safe Vector Access Example Source: https://github.com/emilk/egui/blob/main/CONTRIBUTING.md Shows a safer alternative to direct indexing or `unwrap`/`expect` for accessing the first element of a vector, preventing panics. ```rust let Some(first) = vec.first() else { return; }; ``` -------------------------------- ### Adding InspectionPlugin to egui Context Source: https://github.com/emilk/egui/blob/main/crates/egui_inspection/README.md Integrate egui_inspection into your eframe application by adding the InspectionPlugin to the egui context. This snippet demonstrates initializing the plugin and starting the inspection server. ```rust # let ctx = egui::Context::default(); ctx.add_plugin(egui_inspection::InspectionPlugin::new(Some("my app".to_owned()))); egui_inspection::serve(&ctx, "127.0.0.1:5719").unwrap(); ``` -------------------------------- ### Enabling egui_inspection with Environment Variables Source: https://github.com/emilk/egui/blob/main/crates/egui_inspection/README.md Configure egui_inspection by setting the EGUI_INSPECTION environment variable when running your application with the 'inspection' feature enabled. This example shows binding to the default loopback address. ```sh EGUI_INSPECTION=1 cargo run --features inspection # binds 127.0.0.1:5719 EGUI_INSPECTION=0.0.0.0:5719 cargo run --features inspection # reachable across devices ``` -------------------------------- ### Snapshot Testing Configuration Source: https://github.com/emilk/egui/blob/main/crates/egui_kittest/README.md Illustrates how to configure snapshot testing by enabling `snapshot` and `wgpu` features and using `Harness::snapshot` to generate image comparisons. ```gitignore **/tests/snapshots/**/*.diff.png **/tests/snapshots/**/*.new.png ``` -------------------------------- ### Run egui Demo App with WGPU Backend Source: https://github.com/emilk/egui/blob/main/crates/egui_demo_app/README.md Execute the egui demo application using the wgpu graphics backend. This command navigates into the egui_demo_app directory and runs the application with the specified feature. ```sh (cd egui_demo_app && cargo r --features wgpu) ``` -------------------------------- ### Build and Run egui Demo App Locally Source: https://github.com/emilk/egui/blob/main/crates/egui_demo_app/README.md Compile and run the egui demo app locally using Cargo. Ensure you are in the root directory of the egui project. ```sh ./scripts/start_server.sh & ./scripts/build_demo_web.sh --open ``` -------------------------------- ### Run egui_demo_lib Benchmarks Source: https://github.com/emilk/egui/blob/main/crates/egui_demo_lib/README.md Commands to run all benchmarks, a specific benchmark, or profile benchmarks using cargo-bench, cargo-flamegraph, and cargo-instruments. ```bash # Run all benchmarks car go bench -p egui_demo_lib # Run a single benchmark car go bench -p egui_demo_lib "benchmark name" # Profile benchmarks with cargo-flamegraph (--root flag is necessary for MacOS) CARGO_PROFILE_BENCH_DEBUG=true cargo flamegraph --bench benchmark --root -p egui_demo_lib -- --bench "benchmark name" # Profile with cargo-instruments CARGO_PROFILE_BENCH_DEBUG=true cargo instruments --profile bench --bench benchmark -p egui_demo_lib -t time -- --bench "benchmark name" ``` -------------------------------- ### Run Custom 3D Glow Demo Source: https://github.com/emilk/egui/blob/main/examples/custom_3d_glow/README.md Command to build and run the custom 3D Glow integration demo for the egui project. ```shell cargo run -p custom_3d_glow ``` -------------------------------- ### egui_kittest Configuration File Source: https://github.com/emilk/egui/blob/main/crates/egui_kittest/README.md Shows the structure and default settings for the `kittest.toml` configuration file used to customize test behavior, including output paths and thresholds. ```toml # path to the snapshot directory output_path = "tests/snapshots" # default threshold for image comparison tests threshold = 0.6 # default failed_pixel_count_threshold failed_pixel_count_threshold = 0 [windows] threshold = 0.6 failed_pixel_count_threshold = 0 [macos] threshold = 0.6 failed_pixel_count_threshold = 0 [linux] threshold = 0.6 failed_pixel_count_threshold = 0 ``` -------------------------------- ### Basic egui UI Elements Source: https://github.com/emilk/egui/blob/main/README.md Demonstrates common egui widgets like headings, text input, sliders, buttons, and image display. Use this for building interactive application interfaces. ```rust ui.heading("My egui Application"); u.horizontal(|ui| { ui.label("Your name: "); ui.text_edit_singleline(&mut name); }); u.add(egui::Slider::new(&mut age, 0..=120).text("age")); if ui.button("Increment").clicked() { age += 1; } u.label(format!("Hello '{}', age {}", name, age)); u.image(egui::include_image!("ferris.png")); ``` -------------------------------- ### Add egui_extras and image dependencies Source: https://github.com/emilk/egui/blob/main/crates/egui_extras/README.md To use image loading, add egui_extras with the 'all_loaders' feature and the 'image' crate with desired format features to your Cargo.toml. ```toml egui_extras = { version = "*", features = ["all_loaders"] } image = { version = "0.25", features = ["jpeg", "png"] } # Add the types you want support for ``` -------------------------------- ### Initialize Multiple egui Apps Source: https://github.com/emilk/egui/blob/main/web_demo/multiple_apps.html This code initializes multiple egui applications using wasm-bindgen. It defers execution until the WASM module is ready and handles potential loading errors. Ensure you are using a modern browser with WebGL and WASM enabled. ```javascript delete WebAssembly.instantiateStreaming; console.debug("Loading wasm…"); wasm_bindgen("./egui_demo_app_bg.wasm") .then(on_wasm_loaded) .catch(on_error); ``` -------------------------------- ### Rendering 3D Scene to Texture with egui Source: https://github.com/emilk/egui/blob/main/README.md Render your 3D scene to a texture and display it in egui using ui.image(...). Requires converting the native texture to an egui::TextureId, with specific methods depending on the integration. ```Rust /// A texture id that can be used to identify a texture. /// /// You can create a new texture by calling `textures_delta.set`. /// You can then refer to this texture by its `TextureId`. /// /// `TextureId::default()` is a white texture that you can use as a fallback. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct TextureId(pub usize); impl Default for TextureId { fn default() -> Self { Self(0) // The default texture is a white texture. } } ``` -------------------------------- ### Opt-in to egui_glow Renderer in eframe Source: https://github.com/emilk/egui/blob/main/crates/eframe/README.md To use egui_glow for rendering with eframe, enable the 'glow' feature and configure NativeOptions. This allows switching the renderer from the default wgpu to glow. ```rust NativeOptions::renderer = Renderer::Glow ``` -------------------------------- ### Testing Accessibility with egui_kittest Source: https://github.com/emilk/egui/blob/main/docs/accessibility.md Use `egui_kittest` to query and interact with the AccessKit tree, simulating screen reader behavior. This allows for testing roles and names exposed by widgets. ```rust use egui::accesskit::Role; use egui_kittest::{Harness, kittest::Queryable as _}; let mut harness = Harness::new_ui_state( |ui, accepted| { ui.checkbox(accepted, "Accept terms"); }, false, ); harness .get_by_role_and_label(Role::CheckBox, "Accept terms") .click(); harness.run(); assert!(*harness.state()); ``` -------------------------------- ### Handle Loading Errors Source: https://github.com/emilk/egui/blob/main/web_demo/index.html Callback function executed when an error occurs during WASM loading or application startup. It logs the error and displays an error message to the user. ```javascript function on_error(error) { console.error("Failed to start: " + error); document.getElementById("the_canvas_id").remove(); document.getElementById("center_text").innerHTML = `

An error occurred during loading:

${error}

Make sure you use a modern browser with WebGL and WASM enabled.

`; } ``` -------------------------------- ### Using the Builder Pattern for Widgets Source: https://github.com/emilk/egui/blob/main/README.md egui utilizes the builder pattern for widget construction, offering helper functions for common cases like ui.label("Hello"). ```Rust /// Add a new label to the ui. /// /// This is a shorthand for `ui.add(Label::new(text).text_color(RED));`. pub fn label(&mut self, text: impl Into) -> Response { self.add(Label::new(text)) } ``` -------------------------------- ### Update Snapshots from CI Source: https://github.com/emilk/egui/blob/main/CONTRIBUTING.md Use this script to update your local snapshots from the last CI run of your PR. This is helpful if CI snapshots differ from your local environment, particularly on non-macOS systems. ```bash ./scripts/update_snapshots_from_ci.sh ``` -------------------------------- ### Update Snapshots Source: https://github.com/emilk/egui/blob/main/CONTRIBUTING.md Run this command to update all snapshots, including those for all features. This is useful when CI complains about snapshots, especially if you are not using macOS. ```bash UPDATE_SNAPSHOTS=true cargo test --workspace --all-features ``` -------------------------------- ### Handle egui Loading Errors Source: https://github.com/emilk/egui/blob/main/web_demo/multiple_apps.html This function logs any errors that occur during the WASM loading or application startup process. It also updates the UI to display an informative error message to the user. ```javascript function on_error(error) { console.error("Failed to start: " + error); document.getElementById("center_text").innerHTML = `

An error occurred during loading:

${error}

Make sure you use a modern browser with WebGL and WASM enabled.

`; } ``` -------------------------------- ### Set Android Environment Variables Source: https://github.com/emilk/egui/blob/main/examples/hello_android/README.md Set the necessary environment variables for Android development, including ANDROID_HOME and ANDROID_NDK_ROOT. These are required for 'cargo apk'. ```sh export ANDROID_HOME="$HOME/tools/android" export ANDROID_NDK_ROOT="${ANDROID_HOME}/ndk/29.0.14206865" export PATH="$PATH:${ANDROID_NDK_ROOT}:${ANDROID_HOME}/build-tools/${BUILDTOOLS_VERSION}:${ANDROID_HOME}/cmdline-tools/bin" ``` -------------------------------- ### Providing Widget Information for Custom Widgets Source: https://github.com/emilk/egui/blob/main/docs/accessibility.md Explicitly define accessibility information for custom widgets that draw custom shapes or are visual-only. Use `WidgetInfo::labeled` to specify the role and accessible name. ```rust use egui::{Sense, WidgetInfo, WidgetType}; let (_rect, response) = ui.allocate_exact_size(size, Sense::click()); // Paint using ui.painter(). response.widget_info(|| { WidgetInfo::labeled(WidgetType::Button, ui.is_enabled(), "Open color picker") }); ``` -------------------------------- ### Custom Rendering with Shape::Callback Source: https://github.com/emilk/egui/blob/main/README.md Use Shape::Callback to execute custom code during egui's painting process. This allows integration with various background rendering contexts like glow when using eframe. ```Rust /// Custom rendering callback. /// /// This is a callback that will be called when egui is painting. /// You can use this to draw anything using whatever the background rendering context is. /// When using `eframe` this will be `glow`. /// Other integrations will give you other rendering contexts, if they support `Shape::Callback` at all. #[derive(Clone, PartialEq)] pub struct Callback { pub callback: Arc } impl Shape { pub fn callback(rect: Rect, callback: Arc) -> Self { Self::Callback(Callback { callback }) } } ``` -------------------------------- ### Accessing Context Data with Closures Source: https://github.com/emilk/egui/blob/main/README.md egui uses closures passed to wrapping functions for accessing Context data, like `ctx.input(|i| i.key_down(Key::A))`, to simplify locking and prevent deadlocks. ```Rust /// Access the input state. /// /// This is a shorthand for `self.data.input.key_down(key)`. pub fn key_down(&self, key: Key) -> bool { self.keys_down.contains(&key) } ``` -------------------------------- ### Track files with git-lfs Source: https://github.com/emilk/egui/blob/main/CONTRIBUTING.md Configures git-lfs to track specific files or patterns. This command updates the .gitattributes file. Use `git add --renormalize .` to move already added files to lfs. ```bash git lfs track "path/to/file/or/pattern" ``` ```bash git add --renormalize . ``` -------------------------------- ### Configure Cargo.toml for eframe Source: https://github.com/emilk/egui/blob/main/crates/eframe/README.md Ensure your Cargo.toml is configured for compatibility with eframe. You must use either 'edition = "2024"' or set 'resolver = "2"' in the [workspace] section. ```toml [workspace] resolver = "2" ``` -------------------------------- ### Labeling Text Input Source: https://github.com/emilk/egui/blob/main/docs/accessibility.md Connect a visible label to a text input field for accessibility. The label's ID is used to associate it with the input. ```rust let label = ui.label("User name:"); ui.text_edit_singleline(&mut user_name).labelled_by(label.id); ``` -------------------------------- ### Stop an egui Application Source: https://github.com/emilk/egui/blob/main/web_demo/multiple_apps.html This code snippet demonstrates how to stop and clean up a specific egui application. It removes the canvas element from the DOM and calls the `destroy` and `free` methods on the application handle. ```javascript function on_apps_started(handle_one, handle_two) { const button = document.getElementsByClassName("stop_one")[0] button.addEventListener("click", () => { document.getElementById("canvas_id_one").remove() handle_one.destroy() handle_one.free() }); console.debug("Apps started."); document.getElementById("center_text").remove(); } ``` -------------------------------- ### Push to contributor remote with git-lfs Source: https://github.com/emilk/egui/blob/main/CONTRIBUTING.md Pushes both regular git objects and git-lfs files to a contributor remote. This involves pushing the current branch and then deleting it from the remote, followed by a push of the deleted branch. This is a workaround for specific remote push scenarios. ```bash git push origin $(git branch --show-current) && git push --no-verify && git push origin --delete $(git branch --show-current) ``` -------------------------------- ### Untrack files with git-lfs Source: https://github.com/emilk/egui/blob/main/CONTRIBUTING.md Removes specific files or patterns from git-lfs tracking. This modifies the .gitattributes file. Use `git add --renormalize .` to move already added files back to regular git. ```bash git lfs untrack "path/to/file/or/pattern" ``` ```bash git add --renormalize . ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.