Initialized burrow-gtk project
This commit is contained in:
parent
f31133f4dc
commit
f1d7a98491
26 changed files with 1534 additions and 1 deletions
35
burrow-gtk/src/main.rs
Normal file
35
burrow-gtk/src/main.rs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
mod application;
|
||||
mod config;
|
||||
mod window;
|
||||
|
||||
use self::application::BurrowGtkApplication;
|
||||
use self::window::BurrowGtkWindow;
|
||||
|
||||
use config::{GETTEXT_PACKAGE, LOCALEDIR, PKGDATADIR};
|
||||
use gettextrs::{bind_textdomain_codeset, bindtextdomain, textdomain};
|
||||
use gtk::{gio, glib};
|
||||
use gtk::prelude::*;
|
||||
|
||||
fn main() -> glib::ExitCode {
|
||||
// Set up gettext translations
|
||||
bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR).expect("Unable to bind the text domain");
|
||||
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8")
|
||||
.expect("Unable to set the text domain encoding");
|
||||
textdomain(GETTEXT_PACKAGE).expect("Unable to switch to the text domain");
|
||||
|
||||
// Load resources
|
||||
let resources = gio::Resource::load(PKGDATADIR.to_owned() + "/burrow-gtk.gresource")
|
||||
.expect("Could not load resources");
|
||||
gio::resources_register(&resources);
|
||||
|
||||
// Create a new GtkApplication. The application manages our main loop,
|
||||
// application windows, integration with the window manager/compositor, and
|
||||
// desktop features such as file opening and single-instance applications.
|
||||
let app = BurrowGtkApplication::new("com.hackclub.Burrow", &gio::ApplicationFlags::empty());
|
||||
|
||||
// Run the application. This function will block until the application
|
||||
// exits. Upon return, we have our exit code to return to the shell. (This
|
||||
// is the code you see when you do `echo $?` after running a command in a
|
||||
// terminal.
|
||||
app.run()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue