hello world GUI
This commit is contained in:
parent
e30e885ac7
commit
5265c340b4
3 changed files with 3602 additions and 2 deletions
3572
Cargo.lock
generated
3572
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -6,3 +6,4 @@ edition = "2021"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
eframe = "0.27.1"
|
||||
|
|
|
|||
31
src/main.rs
31
src/main.rs
|
|
@ -1,3 +1,30 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use eframe;
|
||||
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!"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue