Actually, I don't know exactly how I did it, but I know what I did. :shock: :lol: Let me explain:

1) In the latest FPC release (v1.9.8 ) I noticed that they included GTK2 Pascal bindings. So I decided to try a few demos. Most worked fine. But a few didn't. The reason was that the GTK2_4 define was not defined. So that meant that I had to switch on this define and recompile the GTK2 Pascal bindings. I did this using the following method:

a) I edited the Makefile.fpc file in the ".../src/fpc-1.9.8/packages/extra/gtk2" subdirectory, adding "options=-dGTK2_4" in the [compiler] section.
b) I then issued a "fpcmake -w" command. This generated a new Makefile.
c) I then went to the top level of the source tree, ".../src/fpc-1.9.8" and issued a "make all" command, which took a while to run, and then a "make install" command, which moved the compiled binaries to the right place.

I suppose I could have run "make all && make install" from the ".../src/fpc-1.9.8/packages/extra/gtk2" directory, so that only the gtk2 files would be recompiled, instead of all the files in the fpc system, but I guess I wanted to be on the safe/pedantic side.

2) I had already installed Lazarus from source with the "make clean all" command. This by default compiles it with GTK1 bindings on Linux. You should probably do this first.

3) I ran Lazarus, went to Tools | Configure "Build Lazarus", and in the resulting dialog, for "LCL Interface" checked the GTK2 option, and then unchecked the "With Packages" checkbox.

4) From the Tools menu again, I selected Build Lazarus. Then I waited and hoped. And it worked!

I am not sure if step 1 is necessary. But it's a good idea to do it anyway. The GTK2 interface for Lazarus is still very buggy/incomplete, so be prepared for the occasional crash and speed/memory issues.