GTK2 for pascalSourceForge.net Logo


GTK2 for pascal are the bindings for pascal to use the gtk2 libraries (gimp tool kit). Supported Languages are FreePascal and Kylix.
Currently the target platforms are Linux and Win32.



gtk2 for pascal at sourceforge: http://sourceforge.net/projects/gtk2forpascal



CVS access (password is empty, just press return):
export CVS_RSH=ssh
export CVSROOT=:pserver:anonymous@cvs.gtk2forpascal.sourceforge.net:/cvsroot/gtk2forpascal
cvs login
cvs -z3 co gtk2



Compilation:
All units were tested to compile under linux with freepascal 1.0.11 and 1.9.1.

For Lazarus users:
There is lazarus package gtk2forlazarus.lpk.
1. Using gtk2 without the LCL: Add this package in the project inspector to the dependencies of your project.
2. Using the gtk2 interface of the LCL: see the README file, that comes with lazarus in lcl/interfaces/gtk2/README.


The units in topological order:
glib/glib2.pas
pango/pango.pas
atk/atk.pas
gtk+/gdk-pixbuf/gdk2pixbuf.pas
gtk+/gdk/gdk2.pas
gtk+/gtk/gtk2.pas
libglade/libglade2.pas
Compiling the bindings itself is quite easy. An example for FreePascal under linux is the script
compile_with_fpc_under_linux.sh

There is an linking issue under linux. The glib bites the ld-linux.so, so linking requires a strict order. But because fpc provides no option to set the position of the dynamic library a trick is needed to compile any example or any program depending on the gtk2 bindings. The following two lines will compile a program with dynamic libs:
echo INPUT\( `pkg-config --libs gtk+-2.0` \) > gtk2.link.res
ppc386 -XD -k-dynamic-linker=/lib/ld-linux.so.2 -kgtk2.link.res the_program.pas

Under win32 you can simply compile.



Contact: Mattias Gaertner




Links:

FreePascal:
Gtk:




www.freepascal.org
www.gtk.org