Compare commits
2 Commits
54dc50edb6
...
9e962ab9ac
Author | SHA1 | Date | |
---|---|---|---|
|
9e962ab9ac | ||
|
e13df0eb72 |
16
src/main.rs
16
src/main.rs
@ -1,5 +1,5 @@
|
|||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use gtk::{Application, ApplicationWindow};
|
use gtk::{Application, ApplicationWindow, Button};
|
||||||
|
|
||||||
const APP_ID: &'static str = "org.gtk-rs.Gamarjoba";
|
const APP_ID: &'static str = "org.gtk-rs.Gamarjoba";
|
||||||
|
|
||||||
@ -10,9 +10,23 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn build_ui(app: &Application) {
|
fn build_ui(app: &Application) {
|
||||||
|
|
||||||
|
let button = Button::builder()
|
||||||
|
.label("Hit me!")
|
||||||
|
.margin_top(12)
|
||||||
|
.margin_bottom(12)
|
||||||
|
.margin_start(12)
|
||||||
|
.margin_end(12)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
button.connect_clicked(move |button| {
|
||||||
|
button.set_label("Hahaha! Gay!");
|
||||||
|
});
|
||||||
|
|
||||||
let window = ApplicationWindow::builder()
|
let window = ApplicationWindow::builder()
|
||||||
.application(app)
|
.application(app)
|
||||||
.title("Gamarjoba from GTK4")
|
.title("Gamarjoba from GTK4")
|
||||||
|
.child(&button)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
window.present();
|
window.present();
|
||||||
|
Loading…
Reference in New Issue
Block a user