From b8d7fff36ab36cb612e445ed4fe1546d6b153263 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Thu, 24 Jun 2021 18:05:41 -0400 Subject: [PATCH] denthead --- src/main.rs | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) 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