Commits

Virgil Dupras committed 7ca305e

Initial commit. It contains the first tutorial example, 'window-default'

Comments (0)

Files changed (5)

+build
+.waf

01-window-default/main.c

+#include <gtk/gtk.h>
+
+int
+main (int   argc,
+char *argv[])
+{
+  GtkWidget *window;
+
+  gtk_init (&argc, &argv);
+
+  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+  g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
+
+  gtk_widget_show (window);
+
+  gtk_main ();
+
+  return 0;
+}

01-window-default/wscript

+#! /usr/bin/env python
+
+top = '.'
+out = 'build'
+
+def options(opt):
+    opt.load ('compiler_c')
+
+def configure(conf):
+    conf.load ('compiler_c')
+
+    conf.check_cfg (package='gtk+-3.0', uselib_store='GTKLIB', args='--cflags --libs')
+
+
+def build(bld):
+    app = bld (
+        features = 'c cprogram',
+        uselib   = 'GTKLIB',
+        source   = 'main.c',
+        target   = 'window-default'
+    )
+GtkTut - Easy to build Gtk tutorials
+====================================
+
+The Gtk documentation gives a lot of examples, but setting up a build
+environment for them is a bit tiresome. This project takes care of this.
+
+How to build
+------------
+
+`cd` into the subfolder corresponding to the project you want to build and
+then type the following::
+
+	../waf configure
+	../waf
+
+You'll then have an executable in the "build" subfolder.
Binary file added.