You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble figuring out how to get should_close() to work as expected. I'm using Bevy + bevy_egui. What I want to do is "when user closes settings windows, persist settings to disk without having to press a dedicated Save button".
pubfnshow_bg_conf_gui(mutcontexts:EguiContexts,//etc) -> Result{let ctx = contexts.ctx_mut()?;let foo = egui::Window::new("Background settings").open(&mut gui_conf.is_bg_conf_open).title_bar(true).fade_in(true).resizable(true).movable(true).collapsible(true).show(ctx, |ui| {/* config window goes here */if ui.should_close() || ui.will_parent_close(){// doesn't workinfo!("Closing egui for bg conf");}});// doesn't work eitherifletSome(foowin) = foo {if foowin.response.should_close(){info!("Closing egui for bg conf! v2");}}Ok(())}
Neither of those ever trigger. Is there a way to manually assign ClosableTag or did I miss some option in the ui builder to make it work? .closable() didn't exist on any of the objects I tried it on.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm having trouble figuring out how to get should_close() to work as expected. I'm using Bevy + bevy_egui. What I want to do is "when user closes settings windows, persist settings to disk without having to press a dedicated Save button".
Neither of those ever trigger. Is there a way to manually assign
ClosableTagor did I miss some option in the ui builder to make it work? .closable() didn't exist on any of the objects I tried it on.Beta Was this translation helpful? Give feedback.
All reactions