Add button

This commit is contained in:
Greg Shuflin 2022-05-30 13:57:19 -07:00
parent 54dc50edb6
commit e13df0eb72

View File

@ -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,19 @@ 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();
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();