#!/usr/bin/ruby

require 'glib2'
require 'gtk2'

window = Gtk::Window.new
pgbar = Gtk::ProgressBar.new
pgbar.width_request = 400
pgbar.height_request = 32

window.signal_connect("delete_event") {
        puts "delete event occurred"
        false
}

window.signal_connect("destroy") {
        puts "destroy event occurred"
        Gtk.main_quit
}

window.signal_connect("show") {
        while File.exists?("/var/run/createvccontainer")
                pgbar.pulse
		pgbar.text = "Initialisiere Datentresor..."
                while (Gtk.events_pending?)
                        Gtk.main_iteration
                end
                sleep 0.5
        end
        exit 0
}

window.add pgbar
window.window_position = Gtk::Window::POS_CENTER_ALWAYS
window.deletable = false
#window.decorated = false
window.allow_grow = false
window.allow_shrink = false
window.title = "Datentresor"

# window.width_request = 400 
# window.height_request = 100

window.show_all
Gtk.main
