You are here

Tutorial : develop in Vala/GTK+3 under Linux

In our previous post, we wrote a GUI application in Vala, compiled and run it under Windows...

Objectives : use a high-level programming language, GUI app "Windows & Linux-compatible" without source code hacking.

We will port our previous sample to Linux.

1) Install Vala/GTK+3

* under Debian 7.0 "Wheezy" or Ubuntu 12 "Precise Pangolin"
Simply run this command :
apt-get install valac libgtk-3-dev

* under Debian 6.0 "Squeeze" or Ubuntu 10 "Lucid Lynx"
These distros don't have the needed packages...

- We first install GTK+3 with my installers :

* 32-bit "i386" version :
gtk320-DEBIAN60_(TARNYKO).run (42,9 Mb)

* 64-bit "amd64" version :
gtk320-DEBIAN60-AMD64_(TARNYKO).run (43,7 Mb)

- install GLib development libraries :
apt-get install libglib2.0-dev

- manually install Vala 0.12 packages : (2.57 Mb)
(ps : Extract the ZIP archive and type :
dpkg -i libvala-0.12-0_0.12.0-0ubuntu1~llvala2_i386.deb
dpkg -i valac-0.12_0.12.0-0ubuntu1~llvala2_i386.deb
dpkg -i valac-0.12-dbg_0.12.0-0ubuntu1~llvala2_i386.deb
dpkg -i vala-0.12-doc_0.12.0-0ubuntu1~llvala2_all.deb

2) Compile a Vala/GTK+3 program

One of Vala's strengthpoints is that you rarely need to rewrite your source code when switching platforms.
To prove the point, we will simply take our previous sample file back !

Compile : type valac --pkg gtk+-3.0 testGTK.vala.
Run it : ./testGTK and...

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Enter the characters shown in the image.