diff --git a/src/main.rs b/src/main.rs index 38c2722..1cbe1ac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -88,9 +88,10 @@ impl AltairEmulator { ); ui.close_menu(); } - if ui.button("Load binary file").clicked() { + if ui.add_enabled(!self.windows.contains_key("load_bin"), Button::new("Load binary file")).clicked() { self.windows - .insert("load_bin_window", Box::new(LoadBinWindow::new(ui.ctx()))); + .insert("load_bin", Box::new(LoadBinWindow::new(ui.ctx()))); + ui.close_menu(); } }); });