1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Now a WindowEvent::CloseRequested is received will be sent to egui_winit::State in RawInput

Now when we press the close button from a native window if the window has a open variabile connected the window will be closed
This commit is contained in:
Konkitoman
2023-07-24 16:15:34 +03:00
parent 4d883b8217
commit f4a196cddc
6 changed files with 106 additions and 16 deletions

View File

@@ -39,16 +39,17 @@ fn main() -> Result<(), eframe::Error> {
let clone = window1_embedded.clone();
let embedded = *window1_embedded.read().unwrap();
egui::CollapsingHeader::new("Show Test1").show(ui, |ui| {
egui::Window::new("Test1")
.embedded(embedded)
.show(ctx, move |ui, _, _| {
egui::Window::new("Test1").embedded(embedded).show(
ctx,
move |ui, id, parent_id| {
ui.checkbox(&mut *clone.write().unwrap(), "Should embedd?");
let ctx = ui.ctx().clone();
ui.label(format!(
"Current rendering window: {}",
ctx.current_rendering_viewport()
));
});
},
);
});
let clone = window2_embedded.clone();
let embedded = *window2_embedded.read().unwrap();