From 8d6729841e97e5a59b6bd22d61585b36767123d2 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 22 Dec 2015 15:33:42 -0500 Subject: [PATCH] add first source and waf build script --- .gitignore | 2 ++ src/main.vala | 24 ++++++++++++++++++++++++ wscript | 25 +++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 .gitignore create mode 100644 src/main.vala create mode 100644 wscript diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..51b2674 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/build/ +/.waf*/ diff --git a/src/main.vala b/src/main.vala new file mode 100644 index 0000000..20d9166 --- /dev/null +++ b/src/main.vala @@ -0,0 +1,24 @@ +using Gtk; + +int main(string[] args) +{ + Gtk.init(ref args); + + var window = new Window(); + window.title = "File selector demo"; + window.border_width = 10; + window.window_position = WindowPosition.CENTER; + window.destroy.connect(Gtk.main_quit); + + var button = new Button.with_label("Select a file"); + button.clicked.connect(() => { + button.label = "clicked"; + }); + + window.add(button); + window.show_all(); + + Gtk.main(); + + return 0; +} diff --git a/wscript b/wscript new file mode 100644 index 0000000..33e91c6 --- /dev/null +++ b/wscript @@ -0,0 +1,25 @@ +def options(opt): + opt.load("compiler_c") + opt.load("vala") + +def configure(conf): + conf.load("compiler_c") + conf.load("vala") + conf.check_cfg( + package = "glib-2.0", + uselib_store = "GLIB", + mandatory = 1, + args = "--cflags --libs") + conf.check_cfg( + package = "gtk+-3.0", + uselib_store = "GTK", + mandatory = 1, + args = "--cflags --libs") + +def build(bld): + bld.program( + packages = "gtk+-3.0", + target = "vala-file-chooser", + uselib = "GTK GLIB", + source = bld.path.ant_glob("src/**/*.vala") + )