From 54dc50edb67dc05aa7dac7e821881b3e6e6db8d3 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Mon, 30 May 2022 03:37:45 -0700 Subject: [PATCH] Display window --- src/main.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index e7a11a9..2a8bbf6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,19 @@ +use gtk::prelude::*; +use gtk::{Application, ApplicationWindow}; + +const APP_ID: &'static str = "org.gtk-rs.Gamarjoba"; + fn main() { - println!("Hello, world!"); + let app = Application::builder().application_id(APP_ID).build(); + app.connect_activate(build_ui); + app.run(); +} + +fn build_ui(app: &Application) { + let window = ApplicationWindow::builder() + .application(app) + .title("Gamarjoba from GTK4") + .build(); + + window.present(); }