use std::collections::HashMap; use super::Gui; mod song_edit; trait Window { fn show(&mut self, gui: &mut Gui, ctx: &egui::Context, open: &mut bool) -> anyhow::Result<()>; fn name(&self) -> &'static str; } pub enum WindowIndex { SongEdit } pub struct WindowManager { windows: HashMap> } impl WindowManager { pub fn new() -> Self { let mut windows = HashMap::new(); windows.instert(WindowIndex::SongEdit, Box::::default()); Self { windows: HashMap::from_iter([ (WindowIndex::SongEdit, Box::::default()) ]) } } }