2021-06-24 17:05:41 -05:00
|
|
|
mod patch;
|
|
|
|
|
|
|
|
use gtk4::prelude::*;
|
|
|
|
use gtk4::{
|
|
|
|
Align,
|
|
|
|
Application,
|
|
|
|
ApplicationWindow,
|
|
|
|
Button
|
|
|
|
};
|
|
|
|
|
2021-06-23 21:28:05 -05:00
|
|
|
fn main() {
|
2021-06-24 17:05:41 -05:00
|
|
|
let app = Application::new(Some("com.wyattjmiller.snespatcher"), Default::default());
|
|
|
|
app.connect_activate(build_ui);
|
|
|
|
app.run();
|
2021-06-23 21:28:05 -05:00
|
|
|
}
|
2021-06-24 17:05:41 -05:00
|
|
|
|
|
|
|
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();
|
|
|
|
}
|