Archive for February, 2008

Vala examples I

Friday, February 29th, 2008

Some weeks ago, i was thinking about to write a vala tutorial. Finally, i’ve decided to write only vala examples. Easy vala examples that anyone can understand it only reading it once times (or twice times if you don’t undestand it the first time ;) ).

The first example is the clasical “hello world” :


/* hello-world.vala */
/* valac -o hello-world hello-world.vala */

using GLib;

public class Sample : Object {
        public Sample () {
        }

        public void run () {
                stdout.printf ("Hello World\n");
        }

        static int main (string[] args) {
                var sample = new Sample ();
                sample.run ();
                return 0;
        }
}

Happy hacking !!

First post in blogs.gnome.org

Monday, February 25th, 2008

First post in blogs.gnome.org