app.builder/src/main.vala
authorAlan Knowles <alan@roojs.com>
Sun, 15 Mar 2015 02:41:28 +0000 (10:41 +0800)
committerAlan Knowles <alan@roojs.com>
Sun, 15 Mar 2015 02:41:28 +0000 (10:41 +0800)
app.builder/src/main.vala [new file with mode: 0644]

diff --git a/app.builder/src/main.vala b/app.builder/src/main.vala
new file mode 100644 (file)
index 0000000..c90b2c8
--- /dev/null
@@ -0,0 +1,32 @@
+using GLib;
+using Gtk;
+
+static void main (string[] args) {
+    Gtk.init (ref args);
+
+    var window_main = new Window();
+    window_main.title = "Hello world!";
+    window_main.set_default_size (200, 200);
+    window_main.destroy.connect (Gtk.main_quit);
+
+    var vbox_main = new Box (Orientation.VERTICAL, 0);
+
+    lbl_hello = new Label ("Hello!");
+    var btn_bye = new Button.with_label ("Magic!");
+
+    btn_bye.clicked.connect (on_btn_bye_clicked);
+
+    vbox_main.pack_start (lbl_hello, true, true);
+    vbox_main.pack_start (btn_bye, false, true);
+
+    window_main.add (vbox_main);
+
+    window_main.show_all();
+
+    Gtk.main();
+}
+
+static void on_btn_bye_clicked() {
+    lbl_hello.label = "Bye!";
+}