Add the Gtk dependecy to your Cargo.toml
:
[dependencies]
gtk = { git = "https://github.com/gtk-rs/gtk.git" }
Create a simple window with the following:
extern crate gtk;
use gtk::prelude::*; // Import all the basic things
use gtk::{Window, WindowType, Label};
fn main() {
if gtk::init().is_err() { //Initialize Gtk before doing anything with it
panic!("Can't init GTK");
}
let window = Window::new(WindowType::Toplevel);
//Destroy window on exit
window.connect_delete_event(|_,_| {gtk::main_quit(); Inhibit(false) });
window.set_title("Stackoverflow. example");
window.set_default_size(350, 70);
let label = Label::new(Some("Some text"));
window.add(&label);
window.show_all();
gtk::main();
}