1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-28 07:23:13 -04:00

Add nice Id popup

This commit is contained in:
lucasmerlin
2025-03-27 20:43:28 +01:00
parent 4ca5e49722
commit 3a79a32f3d
4 changed files with 167 additions and 10 deletions

View File

@@ -2,6 +2,7 @@
#![allow(rustdoc::missing_crate_level_docs)] // it's an example
use eframe::egui;
use eframe::egui::{Id, Ui};
fn main() -> eframe::Result {
env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).
@@ -28,6 +29,18 @@ fn main() -> eframe::Result {
age += 1;
}
ui.label(format!("Hello '{name}', age {age}"));
Id::new(Id::new("Hi").with((123, "456")))
.with(Id::new("lol"))
.ui(ui);
ui.id().ui(ui);
Id::ui(Ui::id(ui), ui);
ui.unique_id().ui(ui);
let some_button = ui.button("Some button");
some_button.id.ui(ui);
});
})
}