~oktay-acikalin/+junk/gtk-hello

« back to all changes in this revision

Viewing changes to src/gtk-hello.vala

  • Committer: Oktay Acikalin
  • Date: 2013-10-24 07:43:19 UTC
  • Revision ID: oktay.acikalin@gmail.com-20131024074319-40r3irvorx8egbfm
Created initial structure. Created window with button.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
int main (string[] args) {
 
2
        Gtk.init (ref args);
 
3
 
 
4
        var window = new Gtk.Window();
 
5
        window.title = "Hello World!";
 
6
        window.set_border_width (12);
 
7
        window.set_position (Gtk.WindowPosition.CENTER);
 
8
        window.set_default_size (350, 70);
 
9
        window.destroy.connect (Gtk.main_quit);
 
10
 
 
11
        var button_hello = new Gtk.Button.with_label ("Click me!");
 
12
        button_hello.clicked.connect (() => {
 
13
                button_hello.label = "Hello World!";
 
14
                button_hello.set_sensitive (false);
 
15
        });
 
16
 
 
17
        window.add (button_hello);
 
18
        window.show_all();
 
19
 
 
20
        Gtk.main();
 
21
        return 0;
 
22
}