app.builder/src/main.vala
[app.Builder.js] / app.builder / src / main.vala
1 using GLib;
2 using Gtk;
3
4  
5 static void main (string[] args) {
6     Gtk.init (ref args);
7
8     var window_main = new Window();
9     window_main.title = "Hello world!";
10     window_main.set_default_size (200, 200);
11     window_main.destroy.connect (Gtk.main_quit);
12
13     var vbox_main = new Box (Orientation.VERTICAL, 0);
14
15     lbl_hello = new Label ("Hello!");
16     var btn_bye = new Button.with_label ("Magic!");
17
18     btn_bye.clicked.connect (on_btn_bye_clicked);
19
20     vbox_main.pack_start (lbl_hello, true, true);
21     vbox_main.pack_start (btn_bye, false, true);
22
23     window_main.add (vbox_main);
24
25     window_main.show_all();
26
27     Gtk.main();
28 }
29
30 static void on_btn_bye_clicked() {
31     lbl_hello.label = "Bye!";
32 }