GTK window

This commit is contained in:
Christoph J. Scherr 2023-12-02 14:01:18 +01:00
parent 8bb3f761f1
commit ea64c755e9
4 changed files with 43 additions and 1 deletions

5
.gitignore vendored
View File

@ -176,3 +176,8 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder. # option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/ #.idea/
# Added by cargo
/target

9
Cargo.toml Normal file
View File

@ -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"] }

View File

@ -1,5 +1,7 @@
# Baserepo # vshot
vshot is a GUI application with CLI elements that helps extract an image
from a video.
## License ## License

26
src/main.rs Normal file
View File

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