~libredeb/+junk/gtk-hello

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
int main (string[] args) {
    Gtk.init (ref args);

    var window = new Gtk.Window ();
    window.title = "Hello World";
    window.set_border_width (12);
    window.set_position (Gtk.WindowPosition.CENTER);
    window.set_default_size (350, 70);
    window.destroy.connect (Gtk.main_quit);

    var button_hello = new Gtk.Button.with_label ("Click me!");
    button_hello.clicked.connect ( ()=> {
        button_hello.label = "Hello World!";
        button_hello.set_sensitive (false);
    }); 

    window.add (button_hello);
    window.show_all ();

    Gtk.main ();
    return 0;
}