From 9bbc7b8c31458fbf8c639794531e3d324004d8d5 Mon Sep 17 00:00:00 2001 From: Andrew Guschin Date: Sun, 13 Nov 2022 11:40:34 +0400 Subject: =?UTF-8?q?=D0=A0=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=BB=D0=B0=D0=B1=D0=BE=D1=80=D0=B0=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BD=D0=B5=D1=81?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D0=B2=D0=BE=20=D0=BE=D1=82=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D1=83=D1=8E=20=D0=BF=D0=B0=D0=BF=D0=BA=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- labs/src/main.rs | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 labs/src/main.rs (limited to 'labs/src/main.rs') diff --git a/labs/src/main.rs b/labs/src/main.rs new file mode 100644 index 0000000..f672971 --- /dev/null +++ b/labs/src/main.rs @@ -0,0 +1,42 @@ +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>, +} + +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)); + } + } +} -- cgit v1.2.3