add first source and waf build script

This commit is contained in:
Josh Holtrop 2015-12-22 15:33:42 -05:00
parent 6da834d6f9
commit 8d6729841e
3 changed files with 51 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/build/
/.waf*/

24
src/main.vala Normal file
View File

@ -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;
}

25
wscript Normal file
View File

@ -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")
)