denthead
This commit is contained in:
parent
0fccdefe94
commit
b8d7fff36a
40
src/main.rs
40
src/main.rs
@ -1,3 +1,41 @@
|
|||||||
|
mod patch;
|
||||||
|
|
||||||
|
use gtk4::prelude::*;
|
||||||
|
use gtk4::{
|
||||||
|
Align,
|
||||||
|
Application,
|
||||||
|
ApplicationWindow,
|
||||||
|
Button
|
||||||
|
};
|
||||||
|
|
||||||
fn main() {
|
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();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user