eGUI Window



cargo new egui-window
cd egui-window
cargo add eframe

This will make Cargo.toml look like this:


examples/egui/egui-window/Cargo.toml
[package]
name = "egui-window"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
eframe = "0.24"

The code is here:


examples/egui/egui-window/src/main.rs
use eframe::egui;

fn main() -> Result<(), eframe::Error> {
    let options = eframe::NativeOptions {
        viewport: egui::ViewportBuilder::default()
        .with_inner_size([320.0, 240.0]),
        ..Default::default()
    };

    eframe::run_simple_native("Rust Maven egui App", options, move |ctx, _frame| {
        egui::CentralPanel::default().show(ctx, |_ui| {
        });
    })
}

When you click on the X to close the window, you might get lots of warnings like this:


warning: queue 0x7fa398000ca0 destroyed while proxies still attached:

This was reported here.