From ea64c755e9c7a5e88b1b14fc4cdfc7f7152a89d9 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Sat, 2 Dec 2023 14:01:18 +0100 Subject: [PATCH] GTK window --- .gitignore | 5 +++++ Cargo.toml | 9 +++++++++ README.md | 4 +++- src/main.rs | 26 ++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 Cargo.toml create mode 100644 src/main.rs diff --git a/.gitignore b/.gitignore index f9ccf6d..99e098c 100644 --- a/.gitignore +++ b/.gitignore @@ -176,3 +176,8 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ + + +# Added by cargo + +/target diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..b02b729 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "vshot" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +gtk = { version = "0.7.3", package = "gtk4", features = ["v4_8"] } diff --git a/README.md b/README.md index 6afdec7..14b26b2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ -# Baserepo +# vshot +vshot is a GUI application with CLI elements that helps extract an image +from a video. ## License diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..4a04498 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,26 @@ +use gtk::prelude::*; +use gtk::{glib, Application, ApplicationWindow}; + +const APP_ID: &str = "de.cscherr.vshot"; + +fn main() -> glib::ExitCode { + // Create a new application + let app = Application::builder().application_id(APP_ID).build(); + + // Connect to "activate" signal of `app` + app.connect_activate(build_ui); + + // Run the application + app.run() +} + +fn build_ui(app: &Application) { + // Create a window and set the title + let window = ApplicationWindow::builder() + .application(app) + .title("vshot") + .build(); + + // Present window + window.present(); +}