FXRuby

FXRuby is a Ruby extension module that provides an interface to the FOX GUI library. It is Copyright 2001 by Lyle Johnson and released under the GNU Lesser General Public License.

Downloads

The latest version of FXRuby, including the source code distribution and binaries for Microsoft Windows, are always available from the SourceForge project page. The SourceForge releases should always have accompanying release notes describing the changes for that release, and a cumulative ChangeLog file is also included in the FXRuby source code distribution. The file names will always be of the form FXRuby-version.ext, and the version indicates the compatible version of the FOX library that you'll need if you're building from source. The binary distribution for Windows is compatible with the standard, Cygwin-based version of Ruby that's available for download from Ruby Central.

Goals

The primary goal of this project is provide a complete interface to FOX from Ruby. Ruby programs should be able to access FOX classes transparently; this includes deriving new Ruby classes from FOX classes and overriding their virtual functions. FXRuby is still a work in progress and not ready for widespread use; however, the core functionality is in place and I'm well past the "proof of concept" stage. But if you're new to Ruby, and/or you don't know your way around a compiler and Makefiles, you may want to hold off until a later, more mature release of FXRuby is available.

A secondary goal of the project is to promote Ruby and FOX, two great open-source projects that both deserve wider recognition. After discovering Ruby and monitoring the comp.lang.ruby newsgroup postings for only a few weeks, it became apparent that users were dissatisfied with the existing GUI options for Ruby. As with Python, Tk is the de facto standard because of its maturity and availability on a number of platforms (including the Macintosh). But Tk is also showing its age in many ways and it has failed to keep pace with some of the "younger" cross-platform GUI toolkits like FOX, wxWindows, FLTK, Qt and GTK. Of the latter five, only Qt and GTK appear to have usable Ruby interfaces and there are some problems associated with these as well; for Qt, it's the restrictive license for the Windows platform version, and for GTK it's a Windows version that often lags far behind the standard Linux/Unix version. There is clearly a need for a modern, open-source, cross-platform GUI for Ruby, and FOX fills that need.

Building FXRuby from Source Code

If you're planning to use FXRuby on Windows, with the standard Cygwin-based Ruby installation for Windows, you may wish to just download the pre-compiled FXRuby binaries. Otherwise, you will need to compile the shared library for FXRuby from the source code.

These instructions assume that you've already downloaded, compiled and installed FOX. Next, you'll need to download the FXRuby source code tarball and unpack it by typing:

    tar xzf FXRuby-0.99.166-1.tar.gz

This will create a new directory called FXRuby-0.99.166-1. Change to the src subdirectory and run the extconf.rb script, specifying the locations of the FOX header files and library:

    cd FXRuby-0.99.166-1/src
    ruby extconf.rb --with-fox-include=/usr/local/include/fox --with-fox-lib=/usr/local/lib

If you've installed FOX in a different location, you'll obviously need to modify the command-line arguments for extconf.rb. Among other things, this script checks for the presence of optional libraries for PNG and JPEG image support. When it's done, you should end up with a Makefile. To start compiling FXRuby, type:

    make

and then wait awhile. When it finishes compiling, install FXRuby by typing:

    make install

Now you're ready to check out the example programs.

To-do list:

Other Sources of Information

There isn't a lot about FXRuby that is specific to the Ruby language, and so your best sources of information for FOX and FXRuby questions are still the documentation on the FOX Home Page, and the foxgui-users@lists.sourceforge.net mailing list. To subscribe to the latter, please see the information on the FOX home page.

For further information on these related technologies, click on one of the following links:


SourceForge Logo

$Id: index.html,v 1.9 2001/03/22 20:59:55 ljohnson Exp $