diff --git a/src/main.rs b/src/main.rs index e7a11a9..d2bdf56 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,41 @@ +mod patch; + +use gtk4::prelude::*; +use gtk4::{ + Align, + Application, + ApplicationWindow, + Button +}; + fn main() { - println!("Hello, world!"); + let app = Application::new(Some("com.wyattjmiller.snespatcher"), Default::default()); + app.connect_activate(build_ui); + app.run(); } + +fn build_ui(app: &Application) { + let window = ApplicationWindow::builder() + .application(app) + .title("SNES Patcher") + .default_width(600) + .default_height(400) + .build(); + + let button = Button::builder() + .margin_top(10) + .margin_bottom(10) + .margin_start(10) + .margin_end(10) + .halign(Align::Center) + .valign(Align::Center) + .label("Click meh!") + .build(); + + button.connect_clicked( move |button| { + button.set_label("avery is gay"); + }); + + window.set_child(Some(&button)); + window.show(); + } \ No newline at end of file