diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index f672971..0000000 --- a/src/main.rs +++ /dev/null @@ -1,42 +0,0 @@ -mod lab1; -mod lab3; -mod lab6; -mod lab7; -mod lab_trait; - -use eframe::egui; -use lab_trait::Lab; - -fn main() { - let options = eframe::NativeOptions::default(); - eframe::run_native( - "Криптографические методы защиты информации", - options, - Box::new(|_cc| Box::new(Application::default())), - ); -} - -struct Application { - labs: Vec<Box<dyn Lab>>, -} - -impl Default for Application { - fn default() -> Self { - Self { - labs: vec![ - Box::new(lab1::Window::default()), - Box::new(lab3::Window::default()), - Box::new(lab6::Window::default()), - Box::new(lab7::Window::default()), - ], - } - } -} - -impl eframe::App for Application { - fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { - for window in &mut self.labs { - egui::Window::new(window.get_name()).show(ctx, |ui| window.update(ui)); - } - } -} |