hello world GUI

This commit is contained in:
Tom Bloor 2024-04-01 02:11:33 +01:00
parent e30e885ac7
commit 5265c340b4
Signed by: TBSliver
GPG key ID: 4657C7EBE42CC5CC
3 changed files with 3602 additions and 2 deletions

3572
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -6,3 +6,4 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
eframe = "0.27.1"

View file

@ -1,3 +1,30 @@
fn main() { use eframe;
println!("Hello, world!"); use eframe::egui;
fn main() -> Result<(), eframe::Error> {
run_gui()
}
fn run_gui() -> Result<(), eframe::Error> {
let native_options = eframe::NativeOptions::default();
eframe::run_native(
"Nostalgaia Save Editor",
native_options,
Box::new(|cc| Box::new(SaveEditor::new(cc))),
)
}
#[derive(Default)]
struct SaveEditor {}
impl SaveEditor {
fn new(cc: &eframe::CreationContext) -> Self {
Self::default()
}
}
impl eframe::App for SaveEditor {
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
egui::CentralPanel::default().show(ctx, |ui| ui.heading("Hello World!"));
}
} }