From 0f81beb26b6242662b2d82706bcb01680de1e0ad Mon Sep 17 00:00:00 2001 From: yggverse Date: Wed, 18 Sep 2024 16:24:25 +0300 Subject: [PATCH] init main application window --- src/main.rs | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index e7a11a96..87fce67f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,26 @@ -fn main() { - println!("Hello, world!"); -} +use gtk4 as gtk; +use gtk::prelude::*; +use gtk::{glib, Application, ApplicationWindow}; + +fn main() -> glib::ExitCode +{ + let app = Application::builder() + .application_id("io.github.yggverse.Yoda.app") + .build(); + + app.connect_activate( + |app| + { + let window = ApplicationWindow::builder() + .application(app) + .default_width(640) + .default_height(480) + .title("Yoda") + .build(); + + window.present(); + } + ); + + app.run() +} \ No newline at end of file