1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Show id bookkeeping in id test demo

This commit is contained in:
lucasmerlin
2026-03-18 16:55:42 +01:00
parent bbf5e2d728
commit 70435084a9

View File

@@ -47,8 +47,14 @@ impl crate::View for IdTest {
(and if it is, the window will have a new layout, and the slider will end up somewhere else, and so aborting the interaction probably makes sense).");
ui.label("So these buttons have automatic Id:s, and therefore there is no name clash:");
let button_response = ui.button("Button");
let _ = ui.button("Button");
let _ = ui.button("Button");
ui.label("Use id.ui() to show a interactive debug ui that explains how a id was derived:");
button_response.id.ui(ui);
ui.label("Debug formatting the id will also show the hierarchy (useful when logging ids):");
ui.code(format!("{:?}", button_response.id));
ui.vertical_centered(|ui| {
ui.add(crate::egui_github_link_file!());