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://freesoftware.fsf.org/download/fxscintilla/FXScintilla.pkg/1.51/fxscintilla-1.51.tar.gz.

## Compiling FXScintilla

Gilles' 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.51` 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. This process is not so different from the standard build procedure, but you do 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.21>ruby install.rb config --make-prog=nmake -- \
    	--with-fox-include=C:\fox-1.0.34\include \
    	--with-fox-lib=C:\fox-1.0.34\lib \
    	--with-fxscintilla-include=C:\fxscintilla-1.51\include \
    	--with-fxscintilla-lib=C:\fxscintilla-1.51\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