From: Alan Knowles Date: Sun, 15 Mar 2015 02:41:28 +0000 (+0800) Subject: app.builder/src/main.vala X-Git-Url: http://git.roojs.org/?p=app.Builder.js;a=commitdiff_plain;h=f98441f8ea25786bd44017e716e8dd0135985724 app.builder/src/main.vala --- diff --git a/app.builder/src/main.vala b/app.builder/src/main.vala new file mode 100644 index 000000000..c90b2c873 --- /dev/null +++ b/app.builder/src/main.vala @@ -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!"; +}