Appendix B. Using Scintilla with FXRuby
Prev | Part II. Appendices | Next

## 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. It is being developed by Gilles Filippini, and as of this writing the latest release is available for download from http://savannah.nongnu.org/download/fxscintilla/FXScintilla.pkg/1.53/fxscintilla-1.53.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.53` 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:

    $ ruby install.rb config -- \
    	--with-fxscintilla-include=/usr/local/include/fxscintilla \
    	--with-fxscintilla-lib=/usr/local/lib

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

    C:\FXRuby-1.0.25>ruby install.rb config --make-prog=nmake -- \
    	--with-fox-include=C:\fox-1.0.46\include \
    	--with-fox-lib=C:\fox-1.0.46\lib \
    	--with-fxscintilla-include=C:\fxscintilla-1.53\include \
    	--with-fxscintilla-lib=C:\fxscintilla-1.53\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.

Prev | Up | Next
Appendix A. Using OpenGL with FXRuby | Home | Appendix C. Differences between FOX and FXRuby