From e13df0eb72f9b28387e302fafcc6dc1a93f16b05 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Mon, 30 May 2022 13:57:19 -0700 Subject: [PATCH] Add button --- src/main.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 2a8bbf6..7b09705 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,5 @@ use gtk::prelude::*; -use gtk::{Application, ApplicationWindow}; +use gtk::{Application, ApplicationWindow, Button}; const APP_ID: &'static str = "org.gtk-rs.Gamarjoba"; @@ -10,9 +10,19 @@ fn main() { } 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() .application(app) .title("Gamarjoba from GTK4") + .child(&button) .build(); window.present();