Returned back missed title of main window
This commit is contained in:
parent
f4f8f43d3e
commit
1cbbfade75
@ -7,7 +7,10 @@ use bgtu_ai_utility::gui::{boot_eframe, subwindow};
|
|||||||
use eframe::egui;
|
use eframe::egui;
|
||||||
|
|
||||||
fn main() -> eframe::Result {
|
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 {
|
impl eframe::App for gui::MyApp {
|
||||||
@ -19,17 +22,14 @@ impl eframe::App for gui::MyApp {
|
|||||||
None => {}
|
None => {}
|
||||||
Some(board) => {
|
Some(board) => {
|
||||||
subwindow(
|
subwindow(
|
||||||
ui,
|
ui, "board", "Board",
|
||||||
"board",
|
|
||||||
"Board",
|
|
||||||
|vb| {
|
|vb| {
|
||||||
return vb
|
return vb
|
||||||
.with_inner_size(gui::get_board_size(self.boardSize))
|
.with_inner_size(gui::get_board_size(self.boardSize))
|
||||||
.with_resizable(false);
|
.with_resizable(false);
|
||||||
},
|
},
|
||||||
|ui| gui::draw_board(ui, board),
|
|ui| gui::draw_board(ui, board),
|
||||||
)
|
).on_close(|| self.result = None);
|
||||||
.on_close(|| self.result = None);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@ -8,7 +8,10 @@ use bgtu_ai_utility::gui::boot_eframe;
|
|||||||
use eframe::egui;
|
use eframe::egui;
|
||||||
|
|
||||||
fn main() -> eframe::Result {
|
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 {
|
impl eframe::App for gui::MyApp {
|
||||||
|
|||||||
@ -16,7 +16,10 @@ use std::collections::HashSet;
|
|||||||
use bgtu_ai_utility::graph::CompleteGraph;
|
use bgtu_ai_utility::graph::CompleteGraph;
|
||||||
|
|
||||||
fn main() -> eframe::Result {
|
fn main() -> eframe::Result {
|
||||||
return boot_eframe(|| MyApp::new());
|
return boot_eframe(
|
||||||
|
"Ants simulation",
|
||||||
|
|| MyApp::new()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
enum GlobalState {
|
enum GlobalState {
|
||||||
|
|||||||
@ -12,7 +12,10 @@ use egui_extras::{Column, TableBuilder};
|
|||||||
use std::cmp::min;
|
use std::cmp::min;
|
||||||
|
|
||||||
fn main() -> eframe::Result {
|
fn main() -> eframe::Result {
|
||||||
return boot_eframe(|| MyApp::new());
|
return boot_eframe(
|
||||||
|
"Neural net",
|
||||||
|
|| MyApp::new()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,15 @@
|
|||||||
use eframe::egui;
|
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 {
|
let options = eframe::NativeOptions {
|
||||||
viewport: egui::ViewportBuilder::default().with_inner_size([640.0, 400.0]),
|
viewport: egui::ViewportBuilder::default().with_inner_size([640.0, 400.0]),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
eframe::run_native(
|
eframe::run_native(
|
||||||
"Annealing Simulation for Chess Queens Task",
|
title,
|
||||||
options,
|
options,
|
||||||
Box::new(|_cc| Ok(Box::<T>::new(init_data()))),
|
Box::new(|_cc| Ok(Box::<T>::new(init_data()))),
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user