Returned back missed title of main window

This commit is contained in:
Andrew Golovashevich 2026-02-16 01:21:13 +03:00
parent f4f8f43d3e
commit 1cbbfade75
5 changed files with 23 additions and 11 deletions

View File

@ -7,7 +7,10 @@ use bgtu_ai_utility::gui::{boot_eframe, subwindow};
use eframe::egui;
fn main() -> eframe::Result {
return boot_eframe(|| gui::MyApp::new());
return boot_eframe(
"Annealing Simulation for Chess Queens Task",
|| gui::MyApp::new()
);
}
impl eframe::App for gui::MyApp {
@ -19,17 +22,14 @@ impl eframe::App for gui::MyApp {
None => {}
Some(board) => {
subwindow(
ui,
"board",
"Board",
ui, "board", "Board",
|vb| {
return vb
.with_inner_size(gui::get_board_size(self.boardSize))
.with_resizable(false);
},
|ui| gui::draw_board(ui, board),
)
.on_close(|| self.result = None);
).on_close(|| self.result = None);
}
};
});

View File

@ -8,7 +8,10 @@ use bgtu_ai_utility::gui::boot_eframe;
use eframe::egui;
fn main() -> eframe::Result {
return boot_eframe(|| gui::MyApp::new());
return boot_eframe(
"Adaptive Resonance Theory calculater",
|| gui::MyApp::new()
);
}
impl eframe::App for gui::MyApp {

View File

@ -16,7 +16,10 @@ use std::collections::HashSet;
use bgtu_ai_utility::graph::CompleteGraph;
fn main() -> eframe::Result {
return boot_eframe(|| MyApp::new());
return boot_eframe(
"Ants simulation",
|| MyApp::new()
);
}
enum GlobalState {

View File

@ -12,7 +12,10 @@ use egui_extras::{Column, TableBuilder};
use std::cmp::min;
fn main() -> eframe::Result {
return boot_eframe(|| MyApp::new());
return boot_eframe(
"Neural net",
|| MyApp::new()
);
}

View File

@ -1,12 +1,15 @@
use eframe::egui;
pub fn boot_eframe<T: eframe::App>(init_data: impl FnOnce() -> T) ->eframe::Result {
pub fn boot_eframe<T: eframe::App>(
title: &str,
init_data: impl FnOnce() -> T
) ->eframe::Result {
let options = eframe::NativeOptions {
viewport: egui::ViewportBuilder::default().with_inner_size([640.0, 400.0]),
..Default::default()
};
eframe::run_native(
"Annealing Simulation for Chess Queens Task",
title,
options,
Box::new(|_cc| Ok(Box::<T>::new(init_data()))),
)