Appendix B. Using Scintilla with FXRuby

What is Scintilla?

Scintilla is a free source code editing component developed by Neil Hodgson for the Win32 and GTK+ platforms.

What is FXScintilla?

FXScintilla is a FOX widget that wraps around the Scintilla component, or, if you wish, the FOX "port" of Scintilla. Until recently it was developed by Gilles Filippini, and as of this writing the latest release is available for download from http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-1.71.tar.gz.

Compiling FXScintilla

The FXScintilla distribution contains everything you need to build the FXScintilla widget and begin using it in your C++-based FOX applications. That is to say, you do not have to separately download the Scintilla source code from the Scintilla home page. When you unpack the FXScintilla tarball, you should get a new fxscintilla-1.71 directory containing the source code for the FOX port of the Scintilla widget.

As of the 1.46 release of FXScintilla, the build process has been "autoconfiscated" and should seem very familiar to you if you've built other open-source software (like FOX) from the source code. The INSTALL file in the top-level directory should provide enough instruction for you to build and install FXScintilla for either Unix or Microsoft Windows.

Enabling FXScintilla Support in FXRuby

The next step is to build a version of FXRuby (from its source code) with the optional FXScintilla support enabled. If you're working on a Unix or Linux system and have installed FXScintilla in one of the standard installation directories (e.g. under /usr/include or /usr/local/include), the regular FXRuby build process should automatically detect it and enable FXScintilla support.

If you have installed FXScintilla in some non-standard place, or if you're building the code on Microsoft Windows, you will need to specify a few additional configuration options at the beginning.

You can configure the build on Unix or Linux systems by typing:

$ sudo gem install FXRuby-1.6.19.gem -- --with-fxscintilla-include=/usr/local/include/fxscintilla --with-fxscintilla-lib=/usr/local/lib

or, when compiling with Microsoft Visual C++, by typing:

C:\> gem install FXRuby-1.6.19.gem -- --with-fox-include=C:\fox-1.6.36\include --with-fox-lib=C:\fox-1.6.36\lib --with-fxscintilla-include=C:\fxscintilla-1.71\include --with-fxscintilla-lib=C:\fxscintilla-1.71\lib

Past this point, the build and installation process for either platform should be the same as for standard builds. To test your new FXScintilla-enabled build of FXRuby, try running the scintilla-test.rb example program in the FXRuby examples subdirectory.