Chapter 8. Change History
Prev | Part I. The Basics | Next

## Chapter 8. Change History

## Changes For Version 1.0.25 (Released August 5, 2003)

- An error introduced in version 1.0.23 caused a warning message ("useless use of a constant in void context") to be issued when Ruby was run with warnings enabled (see SourceForge Bug 754235). This bug has been fixed. Thanks to Hugh Sasse for reporting the problem.

- The `dilbert.rb` example program, which fetches the daily "Dilbert" cartoon from the Dilbert web site, got broken sometime recently when the image URLs changed (see SourceForge Bug 755040). The program has now been fixed. Thanks to Joel VanderWerf for reporting this problem.

- The `FXGLGroup` class mixed-in Ruby's `Enumerable` module but didn't provide an `each` method for the `Enumberable` module to use (see SourceForge Bug 756609). This problem was fixed by aliasing the existing `each_child` method to `each`. Thanks to Joel VanderWerf for reporting this problem.

- Corrected the return value of `FXVec`'s `normalize!` method, which should have been returning a reference to `self` but was instead returning a reference to a new `FXVec` instance.

- Added a `normalize!` instance method to the `FXHVec` class, for consistency with `FXVec`.

- Due to an error in the GC-related code for `FXTable` and `FXTableItem`, table items were not being properly marked as in-use and as a result could get garbage-collected prematurely (see SourceForge Bug 772337). This bug has been fixed; thanks to Emmanuel Touzery for reporting it.

- The `Fox.fxloadRGB()` module method was implemented incorrectly; it was calling the C++ FOX library's `fxloadGIF()` function instead. This bug has been fixed.

- Finally added support for overriding some of `FXIconItem`'s virtual methods, such as `draw`, `hitItem`, `drawBigIcon`, `drawMiniIcon` and `drawDetails` (see SourceForge Bug 675769). Thanks to Jamey Cribbs for this suggestion.

- A change made in a previous version of FXRuby introduced a bug for some applications (such as DbTalk) when running on Windows (see SourceForge Bug 756672). This bug has been fixed. Thanks to Dalibor Sramek for reporting this problem.

- Added the `drawCircle` and `fillCircle` instance methods to the `FXDC` class.

- Renamed `FXRectangle`'s `move()` instance method to `move!`, to indicate that it is a mutator method.

- The Windows installers for this release were built with FOX version 1.0.42 and FXScintilla version 1.51.

## Changes For Version 1.0.24 (Released June 11, 2003)

- The `initialize` methods for the `FXGLLine` and `FXGLPoint` classes did not properly call the base class version of `initialize,` and as a result these objects were basically unusable (see SourceForge Bug 750940). These bugs have been fixed. Thanks to Peter J. Puchyr for reporting the problem.

- The `each_child` method for `FXGLGroup` was implemented incorrectly (see SourceForge Bug 751345). This bug has been fixed; thanks to Joel VanderWerf for reporting the problem.

- The division operator for the `FXVec` class now raises `ZeroDivisionError` if the dividend is identically zero.

- The `normalize`, `lo` and `hi` methods for the `FXVec` class are now instance methods instead of class singleton methods. Also added a `normalize!` instance method to the `FXVec` class for in-place normalization of the vector.

- Corrected the implementation of the `fxloadTGA` and `fxloadTIF` module methods. For `fxloadTIF`, the image pixel data buffer returned by this method was being truncated and was as a result unusable. For `fxloadTGA`, the data was only being truncated for the case where the image contained all four channels (red, green, blue and alpha).

- Added `FXVisual#visualType()` as an alias for `getType()`.

- Renamed several instance methods for the `FXRectangle` class: the `contains` method is now spelled `contains?` (with the trailing question mark); `grow`, `move` and `shrink` are now `grow!`, `move!` and `shrink!`, to indicate that they are mutator methods; and the "+" and "*" operator methods have been renamed to `union` and `intersect`, respectively, to clearly indicate what they do.

- Due to a buggy implementation of Ruby's `NUM2UINT` macro, the conversion from Ruby integers to C++ unsigned integers could fail on 64-bit platforms. This made it impossible to set certain colors in FXRuby programs (see SourceForge Bug 746606). The problem has been reported to the Ruby core developers, and a workaround was implemented in FXRuby. Thanks to John Kaurin for reporting this problem.

- A couple of bugs in the TextEdit example program caused the undo feature for that program to work incorrectly (see SourceForge Bug 744588). These bugs have been fixed. Thanks to Bill Ramsay for reporting this problem.

- The `beginPrint` and `beginPage` instance methods for `FXDCPrint` were returning `nil` (instead of `true` or `false`) when no block was passed. This bug has been corrected.

- The Windows installers for this release were built with FOX version 1.0.40 and FXScintilla version 1.51.

## Changes For Version 1.0.23 (Released May 20, 2003)

- The contents of this chapter (the Change History) have been confusing for some readers, for a number of reasons. One problem is my choice of wording for the section headings ("Changes Since Version XXX" as opposed to "Changes For Version YYY"), which isn't how most software projects tend to document new releases. Another problem (for users of the Windows installers) is that it was never stated which versions of FOX and FXScintilla were linked into that version of FXRuby. This will now always be listed as one of the bullet points in the change list for a new release. Thanks to John Kaurin and others for their suggestions on how to improve the format.

- The `install.rb` script now tries to automatically detect an FXScintilla installation and enable FXScintilla support for FXRuby. This should work if you installed FXScintilla under either `/usr` or `/usr/include`.

- The `FXWindow#raise` method was hiding Ruby's regular `raise` method, and as a result you couldn't raise exceptions within an instance method of any class derived from `FXWindow` (see SourceForge Bug 728993). The `FXWindow` instance method has been renamed to `raiseWindow`, which of course will break programs that were calling `raise` with the intention of raising a window to the top of the stacking order. But, hey, it's the right thing to do. Thanks to Mark White for reporting this problem.

- Due to an error in how the `FXFileStream#close` and `FXMemoryStream#close` methods were wrapped, calling `close()` on an `FXFileStream` or `FXMemoryStream` instance actually resulted in a call to the base class method (`FXStream#close`). As a result, neither file streams nor memory streams were being closed properly (see SourceForge Bug 733933). This has been fixed; thanks to Thomas Stammeier for reporting this problem.

- The transactional form of `FXFileStream.open` (i.e. the class singleton method that takes a block) had no way of reporting errors to the caller (see SourceForge Bug 732849). An error could occur, for example, if you tried to open a read-only file for writing:

      FXFileStream.open("ReadOnlyFile.doc", FXStreamSave) { |fileStream|
        ...
      }

  Now, `FXFileStream.open` will raise an `FXStreamNoWriteError` exception if it fails for opening a file `FXStreamSave` mode, or an `FXStreamNoReadError` exception if it fails for opening a file in `FXStreamLoad` mode. So to be exception-safe, you'll want to write code that accounts for these possibilities, e.g.

      begin
        FXFileStream.open("ReadOnlyFile.doc", FXStreamSave) { |fileStream|
          ...
        }
      rescue FXStreamNoWriteError
        FXMessageBox.error(getApp().getMainWindow(), MBOX_OK, "Error", "Couldn't open file for writing")
      end

  Thanks to Thomas Stammeier, for reporting a different bug that made me notice this bug.

- A previously corrected bug that caused some objects to be prematurely garbage-collected somehow made its way back into the code (see SourceForge Bug 734738). This bug has been fixed, again, and this time I left myself a nasty comment in the source code and added a regression test to catch it if it tries to resurface in the future.

- Fixed a few problems in the FXRuby example programs related to loading icons from files. One problem, reported by Peter J. Puchyr, was that the loadIcon method in the glviewer.rb example would attempt to display a message box window before the application had been created if some error occurred while reading the icon file (see SourceForge Bug 740122). Another, more pervasive problem, was that the files weren't being closed properly after we were done reading their contents. Both of these problems have been fixed.

- Finished off the drag-and-drop tutorial chapter.

- The Windows installers for this release were built with FOX version 1.0.40 and FXScintilla version 1.51.

## Changes Since Version 1.0.21

- Invalid message data was being sent with various messages from various widgets to their message targets; as a result, some programs could crash if trying to handle those messages (see SourceForge Bugs 711008, 712941 and 714082). All reported bugs have been fixed; thanks to Allen Mitchell, Gilles Filippini and James Adam for reporting these problems.

- If you replaced the application's normal font, default visual, or one of its default cursors with a custom resource, the application could crash on exit, depending on the order in which those objects are garbage-collected (see SourceForge Bug 723450). This bug has been fixed; thanks to Michael Neumann for reporting it.

- Color values can now be specified using a string (or symbol) containing the color name. So, for example, to set the arrow color for an `FXArrowButton` widget to yellow, you could use any of the following three forms:

      arrowButton.arrowColor = FXRGB(255, 255, 0)
      arrowButton.arrowColor = "yellow"
      arrowButton.arrowColor = :yellow

  Note that this feature uses FOX's built in list of color names, which is for the most part identical to the standard X11 color names. The color name matching is case-insensitive, so "yellow", "Yellow" and "YELLOW" will all yield the same result.

- Started a new tutorial section on adding drag-and-drop support to FXRuby applications.

## Changes Since Version 1.0.20

- I've made a lot of progress on the API reference documentation, with perhaps 75% of the FXRuby classes now documented. If you have questions about the documentation, or suggestions about how it can be improved, please feel free to drop me an e-mail.

- Invalid message data was being sent with the `SEL_CLOSE` and `SEL_CLOSEALL` messages from an `FXMDIChild` window to its message target; as a result, some programs could crash if trying to handle those messages (see SourceForge Bug #691672). This bug has been fixed; thanks to Allen Mitchell for reporting it.

- The `bounce.rb` example program was crashing (on Windows only) because the `SEL_CONFIGURE` message handler gets invoked before we've had a chance to call `create()` on the back-buffer image used for the animation (see SourceForge Bug #695091). This has been fixed; thanks to Soso for reporting it.

- Invalid message data was being sent with `SEL_CHORE` messages; as a result, some programs could crash if trying to handle those messages (see SourceForge Bug #702483). This bug has been fixed; thanks to Joel VanderWerf for reporting it.

- For some cases, objects were getting garbage-collected prematurely (see SourceForge Bug #703721). This bug has been fixed; thanks to Michael Mueller for reporting it.

- The message data for `SEL_COMMAND` messages from `FXMenuCommand` objects was not being properly converted to a Ruby instance. This bug has been fixed.

- Corrected the return type for `FXHeader#getArrowDir`. This method was returning either `true` or `false`, but should have been returning an integer (one of `TRUE`, `FALSE` or `MAYBE`) to indicate the arrow direction for a given header item. Also added the `arrowUp?`, `arrowDown?` and `arrowMaybe?` instance methods, which return `true` or `false` depending on the arrow direction for a given header item.

- Incorporated Gilles Filippini's patches for the `iface.rb` script, which generates the `scintilla.rb` library file from the `Scintilla.iface` interface description file. Also used this to update the `scintilla.rb` library file, based on the `Scintilla.iface` file from the FXScintilla 1.51 distribution.

- Added `shared?` as an alias for `FXGLContext#isShared`.

- Added `itemCurrent?` as an alias for `FXListBox#isItemCurrent`.

- Added `size` as an alias for `FXMemoryBuffer#getSize`.

- Added `offeredDNDType?` as an alias for `FXWindow#offeredDNDType`.

## Changes Since Version 1.0.19

- When invoking a Ruby message handler for a `SEL_UPDATE` message, we should have been passing Ruby's `nil` as the message data for the handler, but this wasn't happening. This has been fixed.

- Device contexts should be treated as application-sensitive objects (just like other resources) so that they're destroyed before the application object is during the Ruby interpreter's finalization on exit (see SourceForge Bug #682961). Thanks to Mikkel Jorgensen for reporting this problem.

- The bounds checking for a number of `FXTable` instance methods was incorrect (see SourceForge Bug #689321 and SourceForge Bug #689325). All known bugs have been fixed, and several new tests were added. Thanks to Dalibor Sramek for reporting this.

- The `FXTableItem#getStipple` and `FXTableItem#setStipple` instance methods were broken (see SourceForge Bug #689447). Thanks to Dalibor Sramek for reporting this.

- Corrected a typo in the `INSTALL` file; the URL for the "Things That Can Go Wrong" section of the FXRuby build instructions was incorrect. Thanks to Glenn Lewis and others for reporting this.

- Added `locked?` as an alias for `FXGLViewer#getViewLock()`.

- Added `doesTurbo?` as an alias for `FXGLViewer#doesTurbo`.

- Added `currentItem=` as an alias for `FXIconList#setCurrentItem`.

- Replaced the `swapBytes` accessor methods for the `FXStream` class with `bytesSwapped=` and `bytesSwapped?`.

- Added the new `iconlist.rb` example program.

## Changes Since Version 1.0.18

- The font object associated with `FXGroupBox` objects was not being properly marked as in use during garbage collection. The result was that the font object could get reclaimed prematurely, causing your program to crash (see SourceForge Bug #676498). This bug has been fixed. Thanks to Jason Persampieri for reporting this problem.

- The index bounds checking for some of the `FXIconList` instance methods was using the wrong upper limit and could thus raise a bogus `IndexError` when the index was in fact legal. This was broken for all of the `FXIconList` methods that expect indices into the icon list's header control (e.g. `FXIconList#removeHeader` and `FXIconList#getHeaderText`). This has been fixed.

- The previous release introduced an unintended dependency for all of FXRuby on the Ruby/OpenGL extension (see SourceForge Bug #676089). The code has been modified so that only the `FXGLGroup` class has this dependency; if your code doesn't use this class you shouldn't need to have Ruby/OpenGL installed.

- The Windows installer was missing the new `version.rb` library file. This has been fixed.

- The `Responder2` module, which provides the `connect` instance method for associating messages with handler code blocks, was mistakenly being mixed into the `FXObject` class. This module should really only be mixed into those classes that have a message target (namely, `FXDataTarget`, `FXRecentFiles` and `FXWindow`). This has been fixed.

- When a widget sends a `SEL_MOUSEWHEEL` message to its message target, it should send an `FXEvent` object as its message data. This was not being done (see SourceForge Bug #681189). Thanks to Aaron Schrab for reporting this and for providing a patch to fix the problem.

- Added the `FXSettings#each_section` method, for iterating over the sections in an `FXSettings` object.

- Added the `FXDict#each_key` method, for iterating over the keys in an `FXDict` object.

- Reorganized the SWIG modules in an attempt to reduce the file sizes for FXRuby's C++ source code. Hopefully, this will make it easier to build FXRuby from the source code on machines with limited memory or other problems (see, for example, SourceForge Bug #676490).

## Changes Since Version 1.0.17

- Replaced the SWIG-wrapped version of the `FXGLGroup` C++ class with a Ruby implementation. The previous implementation required some hairy bookkeeping in order to keep track of which group members were "owned" by an `FXGLGroup` object and which ones were not, which in turn determined whether they could be garbage-collected or not. The new implementation is, as a result, much simpler.

- Fixed a bug for `FXText#extractStyle`; if the extracted style bytes contained zeroes (indicating the default style) it would prematurely truncate the returned string. This has been fixed.

- Modified the implementations of `FXGLViewer#readPixels`, `FXText#extractText`, `FXText#getText`, and `FXText#extractStyle` so that they use FOX's memory allocation routines instead of Ruby's ALLOCA_N macro. This change was prompted by numerous reports of the code not compiling on certain platforms (e.g. Solaris) because of the use of ALLOCA_N.

- Removed the -fno-strict-prototype flag from CFLAGS for the Cygwin/MinGW platform builds. This compiler flag was being used as a workaround for some broken function prototypes in the Ruby header files. However, since this flag is no longer supported for gcc-3.2, and since those prototypes are fixed in the Ruby 1.6.8 header files, it's not needed anymore.

- Updated the test cases for compatibility with Test::Unit version 0.1.6.

- Fixed a bug related to the garbage collection of Ruby objects that point to C++ objects that were already destroyed (see SourceForge Bug #660452). Under some circumstances this bug could cause the Ruby interpreter to crash.

- Fixed a bug related to garbage collection for `FXScintilla` widgets (see SourceForge Bug #660541). During garbage collection, the `FXScintilla` objects were being marked as reachable, but they were not in turn marking the objects that they held references to (e.g. their message targets). As a result, the code could eventually crash.

- Added the `Fox.fxrubyversion` module method that returns a string indicating the installed version of FXRuby (e.g. "1.0.18"). For consistency, also changed the return value of `Fox.fxversion` so that it returns a string instead of a three-element array. Thanks to Dalibor Sramek for this suggestion (see SourceForge Change Request #663170).

- A large number of instance methods (especially for list-like classes) have integer `index` arguments that could potentially be out of bounds. In previous versions of FXRuby, these errors weren't handled very well (i.e. the program would exit abruptly with an error message); now, the program should raise an `IndexError` exception when an out-of-bounds index is passed into one of these methods. The affected methods are in the `FXComboBox`, `FXFileList`, `FXHeader`, `FXIconList`, `FXList`, `FXListBox`, `FXSwitcher`, `FXTable` and `FXWindow` classes. A little common sense should tell you which methods are affected.

- Fixed a bug for the `FXTable#setItem` method. The table item passed in to this method should have been modified so that it was marked as "owned" by the table, but that wasn't happening.

- Fixed things so that the `FXTable#createItem`, and the `draw`, `drawButton`, `drawBorders`, `drawContent`, `drawPattern`, and `drawBackground` instance methods for the `FXTableItem` class, can be overridden in Ruby code.

- The patch made for Cygwin builds in the FXRuby 1.0.17 release was not quite right; it has been fixed. Thanks to James Adam for reporting this problem.

- Some of the code from `responder.rb` (one of the FXRuby library files) was generating warnings (see SourceForge Bug #658873). This has been fixed. Thanks to Kurt Hindenburg and John Kaurin for reporting this.

- Added `hasFocus?` as an alias for `FXTableItem#hasFocus`.

- Added the `FXDC#stipple` method, which returns the stipple bitmap (from `FXDC#stippleBitmap`) if it's not nil, otherwise the stipple pattern number (from `FXDC#stipplePattern`).

- Added `horizontalGridShown?` and `verticalGridShown?` as aliases for `FXTable#isHorzGridShown` and `FXTable#vertGridShown`.

- Fixed a typo for the method name `FXCursor#height`, which was misspelled "heigh". Thanks to Roger Sperberg for reporting this.

- In some cases, the internal mapping between C++ `FXEvent` objects and Ruby `FXEvent` instances was not broken when the Ruby was garbage-collected (see SourceForge Bug #665860). This has been fixed. Thanks to Marco Frailis for reporting this problem.

- The message data associated with the `FXTreeList#onDoubleClicked` is expected to be an `FXTreeItem` instance, but was instead being passed as an `FXEvent` instance (see SourceForge Bug #670834). This has been fixed. Thanks to Marco Frailis for reporting this problem.

- Added `grabbedKeyboard?` as an alias for `FXWindow#grabbedKeyboard`.

- The return value for blocks assigned as message handlers wasn't properly getting passed back to the FOX event loop (see SourceForge Bug #675137). This has been fixed. Thanks to Babu Proof for reporting this.

## Changes Since Version 1.0.16

- The `FXMenuCommand#checked?` and `FXMenuCommand#radioChecked?` instance methods were erroneously returning integer values (zero or one) instead of `true` or `false` (see SourceForge Bug #642261). This has been fixed; thanks to Joel VanderWerf for reporting this bug.

- The `fxhsv_to_rgb` and `fxrgb_to_hsv` module methods were not being wrapped (see SourceForge Bug #645878). This has been fixed; thanks to Thomas Husterer for reporting this bug.

- The `FXTopWindow#setPadLeft`, `FXTopWindow#getPadRight` and `FXTopWindow#setPadRight` instance methods, and the corresponding aliases, were missing (see SourceForge Bug #647799). This has been fixed; thanks to John Kaurin for reporting this bug.

- The code wasn't compiling properly with gcc under Cygwin because of a name conflict between the `OpenFile` function declaration (in the `<windows.h>` header file) and the `OpenFile` struct declaration (in the `rubyio.h` header file). See SourceForge Bug #647792 for more of the ugly details. This has been fixed; thanks to Philippe Le Dreau for reporting this bug.

- In some circumstances the use of a large number of timeouts would eventually cause the program to crash; this bug has been fixed. This problem was first reported by David Naseby (see SourceForge Bug #614345) and more recently by Steve Tuckner (see SourceForge Bug #648128). Thanks to both David and Steve for reporting this.

- A bug introduced in FXRuby 1.0.14 could lead to memory leaks in some long-running applications, because some objects were never being garbage-collected, even after they were no longer in use. This bug has been fixed.

- The behavior of the "[]=" method for the `FXVec`, `FXHVec` and `FXMemoryBuffer` classes was inconsistent with that of the `Array#[]=` method. For consistency, those methods should return the value just set (but they were returning `nil`). This has been fixed. Thanks to Joel VanderWerf for catching this one.

- Added the `FXGLShape#position` and `FXGLShape#position=` accessor methods for getting and setting an OpenGL shape's position. Thanks to Joel VanderWerf for this suggestion.

- When the active `FXMDIChild` window for an `FXMDIClient` changes, the client is supposed to send a `SEL_CHANGED` message to its message target and the message data is supposed to be a reference to the active `FXMDIChild` window. This was not working properly (see SourceForge Bug #652099). Thanks to Michael Libby for reporting this bug.

- The `glviewer.rb` didn't work exactly like its C++ equivalent from the regular FOX examples, in that it didn't display a context-sensitive popup menu when you right-clicked in the `FXGLViewer` window background (see SourceForge Bug #646252). This inconsistency has been fixed. Thanks to Joel VanderWerf for reporting this.

- Added the `FXRegistry#readBoolEntry` and `FXRegistry#writeBoolEntry` methods for reading and writing boolean registry values, so that you don't have to convert those to integers or strings (see SourceForge Bug #653279). Thanks to John Kaurin for this suggestion.

- The `FXCheckButton#setCheck` and `FXRadioButton#setCheck` instance methods weren't allowing an input of `MAYBE` to set the "indeterminate" state (see SourceForge Bug #654653). This has been fixed. Thanks to Joel VanderWerf for pointing out this problem.

- Under some circumstances, the an application could crash while the Ruby interpreter is doing its final garbage collection sweep during finalization (see SourceForge Bug #654871). This has been fixed. Thanks to Joel VanderWerf for reporting this problem and providing test cases to help to diagnose it.

- Added `FXWindow#each_child` for iterating over the child windows of a (parent) container window, e.g.

      parentFrame.each_child do |aChild|
        aChild.foo
      end

  Thanks to Joel VanderWerf for this suggestion.

### Deprecated Methods

`FXCheckButton` and `FXRadioButton` widgets can exist in one of three states: checked, unchecked or indeterminate. FOX uses the constants `TRUE`, `FALSE` and `MAYBE` to enumerate these three states. For an example of when an `FXCheckButton` might be in the indeterminate state, consider an application that displays a list of club members. A check button near the list indicates whether the selected member(s) have paid their membership dues. If all of the selected members are paid up, the check button is displayed with a solid check mark (indicating the `TRUE` state). In contrast, if none of the selected members are paid up, the check button should be empty and display no check mark (indicating the `FALSE` state). But what about the case when some of the selected members are paid up and some are not? In this case, the check button's state is `MAYBE`, which is displayed by drawing a "greyed-out" check mark in the box.

In previous releases of FXRuby, the `FXCheckButton#getCheck` and `FXRadioButton#getCheck` instance methods returned `true` if the button state was either `TRUE` or `MAYBE`; otherwise, those methods returned `false`. This was a problem since it left no way to (programatically) distinguish between the `TRUE` and `MAYBE` states.

For this reason, I'm adding the new `getCheckState` instance method to `FXCheckButton` and `FXRadioButton` and deprecating the `getCheck` method. The `getCheckState` method returns an integer value that is equal to one of the three `Fox` module constants `TRUE`, `FALSE` or `MAYBE`. I'm also adding three predicate methods, `checked?`, `unchecked?` and `maybe?` which return true if the corresponding state is in effect for that button. The `getCheck` method will continue to work exactly as it did before, but you'll get a warning message if you're running Ruby in verbose mode (i.e. with the '-w' command line argument).

## Changes Since Version 1.0.15

- Fixed all of the FXRuby library files to ensure that all of them require the "fox" feature before re-opening that module, but that none of them include the `Fox` module (because that would pollute the global namespace). Also make sure that the fully-qualified names for `Fox` module constants and methods are used when necessary. Thanks to Rich Kilmer for helping me sort out these issues.

- `FXDCWindow#new` now takes an optional code block. If a code block is provided, the new device context will be passed into the block as an argument and `FXDCWindow#end` will be called automatically when the block terminates. As an example, this code snippet (from the `scribble.rb` example program):

      dc = FXDCWindow.new(@canvas)
      dc.foreground = @canvas.backColor
      dc.fillRectangle(0, 0, @canvas.width, @canvas.height)
      @dirty = false
      dc.end

  can now be written as:

      FXDCWindow.new(@canvas) do |dc|
        dc.foreground = @canvas.backColor
        dc.fillRectangle(0, 0, @canvas.width, @canvas.height)
        @dirty = false
      end

- Along the same lines, `FXDCPrint#beginPrint` and `FXDCPrint#beginPage` can now take an optional code block. If a code block is provided, the device context will passed into the block as an argument and the appropriate "end" method (either `FXDCPrint#endPrint` or `FXDCPrint#endPage`) will be called automatically when the block terminates.

- Assorted changes to some example programs. Disabled thread checking in the `gltest.rb` example program so that when you tell it to spin the scene using FOX chores, it will be able to do so as fast as possible. Updated the `table.rb` example for consistency with FOX's `table.cpp` example (per Joel VanderWerf's suggestion).

## Changes Since Version 1.0.14

- Fixed a GC-related bug that could cause programs to crash after a call to `FXTable#setTableSize` (see SourceForge Bug #635633). Thanks to Joel VanderWerf for reporting this bug.

- Added a new instance method `FXId#created?` which simply checks to see if the server-side resource associated with an `FXId` has been created (see SourceForge Bug #633398). Thanks to Derek Ney for this suggestion.

- Made a slight change for the initialization blocks added in version 1.0.14 (see SourceForge Feature Request #623878). The optional initialization blocks are no longer evaluated in instance scope. Instead, a reference to the new instance is passed into the block as its single argument. So code that would have been written as:

      FXButton.new(subsplitter, "&Of course\tThis splitter does NOT track") do
        self.frameStyle = FRAME_SUNKEN|FRAME_THICK
        self.backColor = FXRGB(0, 128, 0)
        self.textColor = FXRGB(255, 255, 255)
      end

  would now be written as:

      FXButton.new(subsplitter, "&Of course\tThis splitter does NOT track") do |theButton|
        theButton.frameStyle = FRAME_SUNKEN|FRAME_THICK
        theButton.backColor = FXRGB(0, 128, 0)
        theButton.textColor = FXRGB(255, 255, 255)
      end

  This approach has the advantage that the initialization code now has access to the outer scope, as blocks normally would. Thanks to Rich Kilmer for this suggestion.

- Added `FXGLGroup#<<`, `FXIconList#<<,` `FXList#<<` and `FXListBox#<<` as aliases for those classes' "append item" methods, so that you can write code like:.

      aList = FXList.new(...)
      aList << FXListItem.new("First Item")
      aList << FXListItem.new("Second Item")

- Added an `FXDataTarget#to_s` method that returns the result of calling `to_s` on its value (see SourceForge Feature Request #598271).

- Corrected a bug in the return value for the class method `FXFont.listFonts`; it was basically returning garbage.

- Updated the RAA browser example program (`raabrowser.rb`) to reflect the latest SOAP interfaces to the RAA.

- Corrected one of the tests in the `TC_FXHVec.rb` test case to use `Object#class` instead of `Object#type`; this was triggering a warning message about `Object#type` being deprecated in Ruby 1.7.3.

- Fixed a bug in the `extconf.rb` script for the `$CFLAGS` setting (needed an extra space between some of the compiler flags).

- Fixed a bug that caused the `SCNotification#nmhdr` instance method to return an object of the wrong type (see SourceForge Bug #636713). Thanks to Laurent Julliard for reporting this bug.

- Updated the build instructions and the Scintilla library file (i.e. `fox/scintilla.rb`) for consistency with FXScintilla version 1.49.

## Changes Since Version 1.0.13

- Fixed a long-standing problem related to the FXRuby class hierarchy. Due to some decisions made early on in the FXRuby implementation, the class hierarchy has always been a little broken, but no so much that casual users would notice. Basically, instead of a class hierarchy that strictly follows FOX's, e.g.

      Object > FXObject > FXId > FXDrawable > FXWindow > FXFrame > FXLabel

  you had this weird, shadow hierarchy thing going on, i.e.

      Object > FX_Object > FX_Id > FX_Drawable > FX_Window > FX_Frame > FX_Label > FXLabel

  There was never a lack of functionality and, for the most part, things worked as expected, but it's been nagging at me for a long time and so I finally fixed it. You absolutely should not need to make any changes to your code, and, as I said earlier, many people weren't aware of this problem anyways. But I feel much better now.

- Fixed a couple of bugs related to saving image files from the `imageviewer.rb` example program (see SourceForge Bug #607610). Thanks to Joel VanderWerf for reporting one of these (the use of `fxexists()` instead of `File.exists?`).

- The `FXApp#addInput` and `FXApp#removeInput` instance methods weren't set up quite right for dealing with dual-ported IO objects (see SourceForge Bug #607614). This has been corrected.

- Several of the example programs were printing out debugging messages to the console, which is all well and good until somebody gets hurt. It turns out that when you print to the console from a non-console build of Ruby for Windows (i.e. the `rubyw.exe` version) it will cause the program to crash (see SourceForge Bug #611272). So I've purged all of those print statements, or in some cases turned them into message boxes.

- The `FXProgressDialog` didn't understand how to show itself with a specified placement (e.g. `show(PLACEMENT_OWNER)`) and so calls to `FXProgressDialog#execute` would also fail as a side effect (see SourceForge Bug #621552). Thanks to Austin Ziegler for catching this one. Austin also contributed an updated version of the `datatarget.rb` example that incorporates a dial-shaped `FXProgressBar` widget into its display, showing yet another potential "consumer" of data targets.

- Fixed a bug for the `connect()` instance method. The second argument should accept either a `Method` or `Proc` instance, but it was only handling `Method` inputs. This has been corrected.

- Added initialization blocks for the different classes' `new` methods (see SourceForge Feature Request #611977). So for example, a section of code previously written like this:

      button = FXButton.new(subsplitter,
        "&Of course\tThis splitter does NOT track", nil,
        nil, 0, FRAME_SUNKEN|FRAME_THICK)
      button.backColor = FXRGB(0, 128, 0)
      button.textColor = FXRGB(255, 255, 255)

  could now be replaced with a block like this:

      FXButton.new(subsplitter, "&Of course\tThis splitter does NOT track") do
        self.frameStyle = FRAME_SUNKEN|FRAME_THICK
        self.backColor = FXRGB(0, 128, 0)
        self.textColor = FXRGB(255, 255, 255)
      end

  I resisted doing this for awhile, because I couldn't see any big advantages over the other approach (i.e. the "before" code snippet shown above). But Hal pointed out that with the initialization code block approach you don't have to introduce a new temporary variable to set additional initialization parameters, and that's a good enough reason for me to add it. As with Ruby/Tk, the code in these blocks is evaluated in the new instance's scope (and not the enclosing scope), so keep that in mind.

- It's no longer necessary to call `FXApp#init` after constructing a new `FXApp` instance; this is done automatically. Old code that does call `FXApp#init` should continue to work as before (i.e. there's no harm in calling `init` more than once).

- The `FXApp#beginWaitCursor` instance method now takes an optional code block. If a code block is provided, `FXApp#endWaitCursor` will be called automatically when the block terminates. So, for example, if you have some time-consuming process (say, loading a large file) you can signal this to your application's user like this:

      getApp().beginWaitCursor do
        load_the_file(filename)
      end

- Modified the `FXMAPFUNC` method (and similar methods) to accept symbols in addition to strings for the message handler method names.

- Added an FXRuby version of the "Pig It!" example (one of the Ruby/Tk examples from Programming Ruby).

## Changes Since Version 1.0.12

- Fixed a bug reported by Dalibor Sramek (see SourceForge Bug #596492) for the overloaded versions of some methods (such as `FXList#appendItem`). This bug was introduced in the FXRuby-1.0.12 release.

- Added the `FXCalendar` widget, contributed by David Naseby.

- Some of the example programs depend on other Ruby modules; e.g. the RAA browser example requires the SOAP extension. If you tried to run one of these examples and it couldn't load the required dependencies the program would just bail out, with an error message to the console. This was OK (sort of) for Linux users, but many Windows users were trying to run these examples by double-clicking on their icons in the Windows Explorer. For those unlucky individuals, the program simply doesn't start up and there's no indication of what's wrong. This has been fixed: now you'll get a little error dialog indicating what's missing. Thanks to "Bob" for pointing out this problem.

## Changes Since Version 1.0.11

- Per Hugh Sasse's suggestion, added links from the Examples section directly to the Ruby code for the examples.

- Fixed a bug reported by an anonymous user (see SourceForge Bug #586128) for the various docking options in the `imageviewer.rb` example program.

- Fixed a bug that caused bad data to be sent along with the `SEL_SELECTED` and `SEL_DESELECTED` messages from an `FXTreeList` instance to its message target (see SourceForge Bug #591276). Thanks to Tom Jordan for reporting this bug.

- Fixed some bugs related to the use of styled text in an `FXText` widget and added a small example (`styledtext.rb`) to demonstrate how this works.

- Fixed a problem related to sorting of list items for various widgets (the overridden comparison functions weren't always getting called). Thanks to Tom Jordan for reporting this bug.

## Changes Since Version 1.0.10

- Removed the SWIG typemaps for `FXTableRange` and `FXTablePos` output values which would previously have tried to look up existing Ruby references to the same C++ pointers and return those. This practice (which works fine in most cases) was leading to an obscure bug (see SourceForge Bug #560128). See the `ChangeLog` comments for more details about the problem. Thanks to Joel VanderWerf for reporting this problem.

- Made the constructors for `FXDrawable`, `FXShell` and `FXTopWindow` public so that these classes can be subclassed (see SourceForge Bug #568765). Thanks to Laurent Julliard for reporting this problem.

- Fixed a bug in the `inputs.rb` example program that caused it to loop indefinitely even after the read pipe was empty. This would cause the text buffer to get filled with garbage for some cases.

- Updated the FXScintilla-related documentation and build scripts to reflect the new build and installation process for FXScintilla version 1.46. Thanks to Laurent Julliard for providing me with most of this information.

## Changes Since Version 1.0.3

- Corrected the code for `FXTreeList#clearItems` so that after the C++ objects (the tree items) are destroyed, any Ruby instances holding references to those C++ objects are notified of their demise. This one was inadvertently overlooked when other, similar, fixes were made in the previous release. Thanks to Gilles Filippini for catching this.

- The API for Ruby's `rb_rescue2()` function changed in Ruby 1.6.7, but I missed this since I had only compiled against the Ruby 1.6.6 and Ruby 1.7 header files. The API change led to a compile error for FXRuby.cpp; this has been fixed. Thanks to Bil Kleb for catching this one.

- The `FXApp#enableThreads` and `FXApp#disableThreads` instance methods have been replaced by a single instance method, `FXApp#threadsEnabled=`, which takes a boolean argument as its input. Also added a new instance method, `FXApp#threadsEnabled?`, which returns the current value for this setting.

- The `FXToolbar#dock` instance method could crash if the default value of `nil` was used for the second argument (see SourceForge Bug #550417). This has been fixed.

- Calls to `FXFileDialog.getOpenFilename` could crash if the fourth argument's default value was used instead of explicitly specifying its value (see SourceForge Bug #550349). This has been fixed.

- Added input typemaps for `FXVec` and `FXHVec`, such that any method which expects one of these types as input will also accept a Ruby array of the same size. For example, `FXGLViewer#backgroundColor=` can now be called in either of these equivalent forms:

      glviewer.backgroundColor = FXHVec.new(0.5, 0.5, 0.5, 1.0)

  or

      glviewer.backgroundColor = [0.5, 0.5, 0.5, 1.0]

- Updated the test case for `FXMaterial`, added a new test case for `FXFileStream`.

- Added aliases `posVisible?` (for `FXTextField#isPosVisible`), `posSelected?` (for `FXTextField#isPosSelected`), `itemCurrent?` (for `FXComboBox#isItemCurrent`), `hasAccel?` (for `FXAccelTable#hasAccel`), `error=` (for `FXStream#setError`), `position=` (for `FXStream#setPosition`) and `position` (for `FXStream#getPosition`).

- The `FXStream`, `FXFileStream` and `FXMemoryStream` classes were not implemented properly, in the sense that if you subclassed one of these classes and then attempted to override one of their virtual functions, that override might not get called (see SourceForge Bug #535955). This has been fixed.

- Did some more work on completing the `FXDC` interface, including adding a test case for the same. Also added a new example `dctest.rb` that demonstrates many of the `FXDC` interface.

- All GIF image files have now been replaced with PNG equivalents. For more information on why this is a good idea, see this site.

- Starting with this release, Red Hat Linux 7.2 RPMs are now provided in addition to the Windows installer.

- The previous implementation of `FXImage#data` returned a copy of the underlying image pixel data instead of a pointer to the actual data (see SourceForge Bug #550996). This has been fixed. `FXImage#data` now returns an instance of `FXMemoryBuffer` which is an array or string-like class that acts as a very thin layer over the pointer to the pixel data. The `initialize` methods for images and icons were also updated so that they will now accept either strings (as before) or `FXMemoryBuffer` instances as inputs for the image data.

- Modified the `range` and `range=` methods for `FXDial`, `FXSlider` and `FXSpinner` so that they work with Ruby `Range` objects instead of pairs of integers for the low and high values.

- Lots of other little fixes here and there...

## Changes Since Version 0.99.189

- Upgraded to the latest version of Minero Aoki's `install.rb` script.

- Switched from using DocBook/SGML to DocBook/XML for the FXRuby documentation. This is mainly a maintenance issue; it's just much less complicated to "publish" documents using DocBook/XML as compared to DocBook/SGML. You should see few (if any) differences in the resulting HTML pages, but let me know if you notice anything squirrely.

- Improved support for customized sorting of list items for the `FXComboBox`, `FXIconList`, `FXList`, `FXListBox`, `FXTreeList` and `FXTreeListBox` classes. The model is different from that used in the C++ FOX library, where you set a global sorting function for each list instance. For FXRuby, you instead just override the list item's `<=>` method to compare one list item to another. Thanks to Martin Stannard for prompting me to resolve this problem.

- Added instructions about how to modify your `/etc/ld.so.conf` file (on Linux) to include the `libFOX.so` installation directory. Thanks to Giuseppe Cacopardo for providing this information.

- Updated the test cases (again) for use with Nathaniel Talbott's TestUnit, which is apparently the successor to Lapidary.

- Added support for the `FXCURCursor`, `FXRGBIcon`, `FXRGBImage` classes.

- Fixed a longstanding bug related to the ownership (for garbage collection purposes) of `FXGLGroup` and `FXGLShape` instances. This is the bug that was causing the `glviewer.rb` example program to crash on exit.

- Fixed a different (but also longstanding) bug related to FXRuby's hanging on to "stale" Ruby object references after those Ruby objects had already been garbage-collected. This bug manifested itself in a number of ways, but the most common symptom would be for an object (like an `FXEvent` instance) to suddenly lose its mind and believe it was some other object. Oh, and your program would usually crash at that point. I think this problem is now fixed.

- Added some safeguards for "destructive" functions like `FXList#clearItems`, which can destroy the C++ objects backing-up Ruby objects in FXRuby, so that any outstanding Ruby references to those destroyed C++ objects are left in a safe state when accessed by Ruby's garbage collector.

- Performed a major overhaul on the `shutter.rb` example program, which still demonstrates the `FXShutter` widget but otherwise doesn't resemble its previous incarnation at all.

- Added a new example program (`raabrowser.rb`) that allows you to browse the Ruby Application Archive via its SOAP interface. Requires the SOAP4R extension.

- Added a new example program (`babelfish.rb`) that allows you to use the Babelfish translator web service via its SOAP interface. Requires the SOAP4R extension.

- Added a new page to the documentation to briefly describe each of the example programs (including screenshots).

- The CVS repository for FXRuby is now hosted at the SourceForge site. For those who would like access to the latest version of FXRuby (in-between official releases) this is now an option. For more details, see the instructions at the SourceForge project CVS page.

- Updated the interfaces for compatibility with fox-1.0.3.

## Changes Since Version 0.99.188

- Fixed a big bug related to the `FXApp#addSignal` and `FXApp#removeSignal` functions, which should accept a string signal name as an argument. The list of recognized signal names was not constructed properly and as a result most any call to these methods with a string signal name would fail. This has been corrected, and the methods now throw exceptions like those thrown from `Process::kill` when the signal name is unrecognized or the argument type is wrong.

- The `imageviewer.rb` example program now supports loading TARGA, ICO and TIFF image files.

- The configuration process on Windows should now detect the presence of `libtiff.lib` properly.

- Updated the interfaces for compatibility with fox-0.99.189.

## Changes Since Version 0.99.181

- Removed the `-fno-strict-prototype` and `-fpermissive` flags from the `CFLAGS` for Linux builds, since these two flags are no longer supported for more recent versions of gcc. Thanks to Thomas Lundqvist for reporting this.

- Some of the source files included in the previous release had DOS-style line endings and this caused gcc to choke while compiling them; this has been fixed. Thanks to Thomas Lundqvist for reporting this.

- Updated the FXRuby test cases (such as they are) to use Nathaniel Talbott's Lapidary unit testing framework.

- Migrated yet more code from the C++ extension to pure Ruby versions. Most of the code for the `FXPoint`, `FXRectangle` and `FXSize` classes is now implemented in Ruby.

- Fixed a bug in the `browser.rb` example. I had meant for the methods and constants lists to be sorted but had failed to use the in-place `sort!` method. Thanks to Robert Gustavsson for reporting this.

- Completed a lot of the initial work for integrating the FXScintilla widget into FXRuby. This is not usable yet, but I'm working with Rich Kilmer and others to try to make this happen.

- Updated the build instructions to provide more information about building the Visual C++ version of FXRuby (i.e. for use with the Visual C++ build of Ruby) on Windows. Thanks to a final tip from Martin Stannard we now have a working build for this compiler.

- For fun, added a new example program that downloads today's Dilbert cartoon from the DilbertZone web site and displays it in an `FXImageViewer` widget. Requires the `html-parser` module, listed in the Ruby Application Archive.

- Updated the interfaces for compatibility with fox-0.99.188.

## Changes Since Version 0.99.180

- Added `slices`, `stacks` and `loops` accessors for the `FXGLCone` and `FXGLCylinder` classes, to provide finer control over the rendering fidelity for these shapes (this was already done for `FXGLSphere` in the previous release).

- Updated the interfaces for compatibility with fox-0.99.181.

## Changes Since Version 0.99.174

- Moved the class definitions for `FXGLPoint`, `FXGLLine`, `FXGLCube`, `FXGLCylinder`, `FXGLSphere` and `FXGLCone` to a new library module `fox/glshapes.rb`. The interfaces are the same as the C++ versions of these classes, this is just a "pure Ruby" implementation of the classes instead of wrappers around the C++ classes. See `examples/glviewer.rb` for an example of their use.

- Fixed a bug related to object ownership for GL objects added to a `FXGLGroup`.

- Added support for overriding the virtual `layout` method in classes derived from `FXWindow`. This will allow developers to, for example, develop new kinds of layout managers.

- Replaced the previous WISE-based installer for the Windows version with an Inno Setup-based installer and reorganized things to better reflect the organization used in the standard Ruby installer.

- Updated the setup and build script to the latest version of Minero Aoki's scripts (version 3.0.2). The main change for FXRuby end-users is that the name of the build script is now `install.rb` instead of `setup.rb`.

- Added the `colors.rb` library file, for predefined color names in the `FXColor` namespace. The use of this module allows you to use symbolic names like `FXColor::Red` instead of an RGB constant like FXRGB(255, 0, 0). Many thanks to Jeff Heard for this suggestion and the contributed file.

- The `FXRegion` was accidentally being renamed to `FX_Region` (a little behind-the-scenes magic I'm doing in FXRuby) and as a result you couldn't use this class. Thanks to Steven Grady for catching this bug.

- The `FXFileStream` class now supports a Ruby-style `open` singleton method that provides transactional control for closing the file stream when it's done. See the `image.rb` and `imageviewer.rb` examples for how this works.

- After some discussions at RubyConf and follow-up discussions on the comp.lang.ruby newsgroup, the procedure for attaching events handlers to FXRuby widgets has been greatly simplified. Most of the example programs have been updated to reflect these changes, and a new documentation section has been added to describe how it works. For some of the background, please see this page on the RubyGarden Wiki.

- Added support for the `each_row` and `each_column` iterators for the `FXTable` class. These iterators yield an array of references to `FXTableItem` instances, one per row or column, respectively. Note that the `each` method is just an alias for `each_row`.

- Removed the interfaces for `fxrandom`, `fxmalloc`, `fxcalloc`, `fxresize`, `fxmemdump`, and `fxfree`. These utility functions are not relevant for FXRuby.

- Corrected interfaces for `fxhsv_to_rgb` and `fxrgb_to_hsv` so that they return three-element arrays of the converted color components.

- Corrected interfaces for `FXWindow#acquireSelection`, `FXWindow#acquireClipboard` and `FXWindow#beginDrag` to take an array of drag types.

- Corrected interfaces for `fxsaveBMP`, `fxsaveGIF`, `fxsaveICO`, `fxsavePCX`, `fxsavePNG`, `fxsaveTIF` and `fxsaveXPM` so that they expect a Ruby string (containing the image pixel data) as their second argument.

- Updated the interfaces for compatibility with fox-0.99.180.

## Changes Since Version 0.99.173

- Moved all of the method name aliases out of the C interface code and into a new library file (`fox/aliases.rb`). This file is loaded automatically so you don't need to change your code. Similarly, moved all of the iterator methods out of the C code and into a library file (`fox/iterators.rb`). The main purpose of these changes is to reduce the size of the C++ code (especially `core_wrap.cpp`) where possible. Obviously, compared to recompiling the C++ source code, it's also much more efficient to quickly patch the Ruby files and re-run when there are problems.

- A few errors made it into the `undolist.rb` library module and the `textedit.rb` example last time; I think these have been fixed.

- I meant to add support for the new `FXPCXIcon` and `FXPCXImage` classes with the last release, but somehow I overlooked those. They are now supported, along with the other new classes introduced by FOX version 0.99.174: `FXTIFIcon`, `FXTIFImage` and `FXProgressDialog`.

- Fixed a bug in the GC-related code for "marking" C++ objects. I had not accounted for the possibility that the pointer passed to my mark functions could be a `NULL` pointer, and as a result the code would seg fault during garbage collection, under some circumstances. Many thanks to Ralf Canis for catching this bug.

- Updated the source code and `extconf.rb` files so that FXRuby configures and builds correctly for the "mswin32" builds. Thanks very much to Lorien Dunn for prompting me to get this stuff up-to-date!

- Fixed things so that the `FXApp#addInput` and `FXApp#removeInput` instance methods work properly for generating input messages. The first argument to both of these methods should be an `IO` object of some kind (specifically, an object that implements a `fileno` method). For more information about how this works, see the "Timers, Chores, Signals and Input Messages" section of the FOX documentation. Also see the new `inputs.rb` program in the `examples` directory for an example of how this works. Thanks to Ralf Canis for reminding me that I left this broken!

- Completed the basic code changes required for `FXObject#handle` to properly convert its message data into something that the C++ objects recognize (see the first item in the FXRuby To-Do List for more information). A lot of message types and identifiers are now handled correctly, especially those that are common to all `FXWindow`s. Most of the more widget-specific messages are not handled yet, and this is going to take awhile to complete; it's just a tedious process.

- Updated the interfaces for compatibility with fox-0.99.174.

## Changes Since Version 0.99.172

- Changed the build and installation process to use Minero Aoki's `setup.rb` tools. Looking ahead I can see that FXRuby will probably consist of a core C++ extension module and a collection of Ruby library scripts, and so now was the right time to make that transition.

  If you have previously installed FXRuby (and written programs with the same) there are a few changes that may affect you. First, `setup.rb` will install the shared library (`fox.so`) in your `site_ruby` directory instead of the "core" libraries directory, where it was previously installed. So you should be sure to remove the old version of `fox.so` before installing and using this one.

  The other change to be aware of is that there is now a `fox` directory containing FXRuby library scripts, and the `responder.rb` module is the first entry for this directory. You can import this file into your Ruby scripts with the line:

      require 'fox/responder'

  and it's no longer necessary to drag copies of that file around.

- Aliased the `getText` instance method to `to_s` for a number of classes. This change should make things a little more convenient when inspecting the contents of widgets whose primary purpose is text entry or display. Thanks to Barry Shultz for this suggestion.

- Added the `FXWindow#removeChild` method for removing child widgets from a container window. This method doesn't exist for the C++ `FXWindow` class because it isn't needed; in C++ programs you simply delete the C++ object and it automatically gets removed from its parent. Note that after you call `FXWindow#removeChild` any outstanding references to the recently deceased child widget are invalid and should be set to `nil` or otherwise disposed of. Thanks to Ted Meng for noticing this omission.

- Modified some of the OpenGL method calls in `gltest.rb` for compatibility with Ruby/OpenGL 0.32. You should now be able to use Ruby/OpenGL with FXRuby unmodified.

- Added `each()` instance methods for `FXComboBox`, `FXGLGroup`, `FXHeader`, `FXIconList`, `FXList`, `FXListBox`, `FXTreeItem`, `FXTreeList` and `FXTreeListBox` in support of iterating over their sub-items. Also mixed the `Enumerable` module into all of these classes.

- Corrected the implementations of `getData()` and `setData()` for a variety of classes. You should now be able to attach arbitrary (application-defined) data to any FOX object that supports these APIs.

- As a debugging tool, you can now optionally catch exceptions raised in message handlers. To turn on this feature, call the `setIgnoreExceptions(true)` module method. When this is enabled, any exceptions raised in message handler functions will cause a standard stack trace to be dumped to the standard output, but then your application will, for better or worse, proceed normally. Thanks to Ted Meng for this suggestion.

- Extended the interfaces for `FXApp#addSignal` and `FXApp#removeSignal` to accept either a string or integer as their first argument. If it's a string (e.g. "SIGINT" or just "INT") the code will determine the corresponding signal number for you (similar to the `Process.kill` module method). For examples of how to use this, see the `datatarget.rb` or `imageviewer.rb` example programs.

- Corrected the implementations of `fxparsefontdesc()` and `fxunparsefontdesc()` module methods.

- Added a pure Ruby implementation of the standard `FXCommand` and `FXUndoList` classes from the standard FOX library.

- Added the `splitter.rb` example, to demonstrate the `FXSplitter` class and its options.

- Completed the initial version of `browser.rb`, which is just a simple tool to inspect the methods and constants exposed by different FOX classes. Thanks to Albert Wagner for pointing out some bugs in this one and providing me with the motivation to complete it. I don't know how useful it is, but it seems to be a required utility for every GUI toolkit for Ruby ;) If you'd like to suggest further improvements, please feel free!

- Corrected the constructors for `FXXPMIcon` and `FXXPMImage` so that they accept a list of strings as their second argument. The list of strings should be an XPM format image file. You can also pass `nil` to construct an initially-empty icon or image.

- Corrected the message data sent by `FXList` to its message target for the `SEL_SELECTED`, `SEL_DESELECTED`, `SEL_INSERTED`, `SEL_DELETED`, and `SEL_REPLACED` messages. For each of these messages, the data should be an integer indicating the affected list item's index.

- Added typemaps to convert Ruby message data back into C++ void pointers when calling the base class versions of message handlers. Please see the to-do list for a brief discussion of the issues that this fix addressed, and what remains to be done.

- Fixed a subtle GC bug related to object ownership. I'll use the `FXList` and `FXListItem` classes to describe the problem, but it's also relevant for several other FOX classes.

  There are two ways to add a new list item to an `FXList` instance. One of those ways involves creating a new `FXListItem` instance explicitly (i.e. using `FXListItem.new`) and then passing it into an `FXList` instance method like `FXList#appendItem`. Before you add the item to the list, the item is "self-owned"; in other words, if Ruby's garbage collector decides to kill off that `FXListItem` instance, it is appropriate to also destroy the underlying C++ object. After the list item has been added to an `FXList`, however, the `FXList` owns that list item and is responsible for destroying it.

  This bug became an issue when you added `FXListItem` instances to a list, because the code didn't properly recognize the fact that "ownership" of the list item had been transferred from the `FXListItem` instance to the `FXList`. More to the point, Ruby's garbage collector assumed that it was still OK to destroy the `FXListItem` instances that it knew about, and so objects could get deleted twice. This would usually result in a core dump.

  Many thanks to Albert Wagner for submitting an example program that demonstrated this problem.

- Updated the interfaces for compatibility with fox-0.99.173.

## Changes Since Version 0.99.167

- Completed the coding for "safe" coexistence with Ruby's garbage collector; it should no longer be necessary to call `GC.disable` at the top of your FXRuby programs. Although all of the example programs now work correctly without disabling the garbage collector, this doesn't mean that there aren't still some bugs lurking. If your FXRuby program(s) crash mysteriously, try adding `GC.disable` to the top to see if it fixes things. If this does make a difference, please send me the program (or another that reproduces the problem) so I can track down what's going wrong.

- Added aliases for all classes' accessor functions so that the related properties can be accessed more directly; for example, `FXLabel#getText` is aliased to `FXLabel#text` and `FXLabel#setText` is aliased to `FXLabel#text=`. Although the different forms are functionally equivalent, the new form is often easier to read. For example, consider this snippet of code that modifies a label's text:

      aLabel.setText(aLabel.getText() + " (modified)")

  and this version of the same, now using the propery accessor functions:

      aLabel.text += " (modified)"

  None of the standard FOX class APIs have been removed, so you shouldn't need to modify any already-working code.

- Corrected the message data sent from the `FXText` widget to its message target for the `SEL_SELECTED`, `SEL_DESELECTED`, `SEL_INSERTED`, `SEL_DELETED` and `SEL_REPLACED` message types. For the first four messages, the associated message data sent to the target will be an array of two integers indicating the starting position in the text buffer and text length for the affected text. For the `SEL_REPLACED` message type, the message data will be an array of three integers, indicating the starting position in the text buffer, the length of the old (replaced) text, and the length of the new text.

- Updated the interfaces for compatibility with fox-0.99.172.

## Changes Since Version 0.99.166-1

- Corrected the interfaces for `FXInputDialog.getString`, `FXInputDialog.getReal` and `FXInputDialog.getInteger` to either return the requested type or `nil` if the user cancels the dialog.

- Added code at the top of all the examples to disable Ruby's garbage collector, until the issues with GC are resolved.

- Corrected implementations for the overloaded versions of `FXWindow#update`. This method can be invoke with no arguments (in which case it updates the entire window) or with four arguments indicating the x, y, w and h of the client area to be updated.

- Modified how the return values from Ruby message handler functions are interpreted, to make things a little more convenient for programmers. If the result is a numeric type (`Fixnum`, `Bignum` or `Float`) we try to cast it to a long integer but also trap the value to either zero or one. If it's a boolean result we map `false` and `true` to zero and one, respectively. For any other return type (`nil`, strings, etc.) we just assume they meant to return 1. Thanks to Ted Meng for this suggestion.

- Modified the interfaces for `FXFileDialog#getPatternList`, `FXFileSelector#getPatternList`, `FXFileDialog#setPatternList` and `FXFileSelector#setPatternList` to take (or return) an array of strings (one array item per pattern) of the form "C/C++ Files (*.cpp)". This is sort-of a compromise between the currently available overloaded C++ versions of these functions, both of which look pretty awkward in Ruby. For an example of how this works now, see the `imageviewer.rb` example program.

- Added the FOX key cap definitions (i.e. the symbols from `fxkeys.h`) into FXRuby. Thanks to Benedikt Grundmann for pointing out this omission.

- Added initial support for multithreaded FXRuby applications. The current implementation does what is also done in Ruby/GTK; it turns over some idle processing time to the Ruby thread scheduler to let other threads do their thing. As I learn more about Ruby's threading implementation I may try something different, but this seems to work OK for now. As a simple example, I modified the `groupbox.rb` example program so that the clock label that appears in the lower right-hand corner is continuously updated (by a separate thread) instead of just displaying static text.

  If you suspect that FXRuby's threads support is interfering with your application's performance, you may want to try tweaking the amount of time that the main application thread "sleeps" during idle processing; do this by setting the `FXApp` object's `sleepTime` attribute. The default value for `FXApp#sleepTime` is 100 milliseconds. You can also disable the threads support completely by calling `FXApp#disableThreads` (and subsequently re-enable it with `FXApp#enableThreads`.

- Started adding RubyUnit-style test cases to the `tests` subdirectory. There's not much there yet but we've got to start somewhere!

- Converted most of the documentation over to DocBook format and reorganized the web page accordingly.

- Updated the interfaces for compatibility with fox-0.99.167.

## Changes Since Version 0.99.166

- Corrected a problem with the binary distribution (i.e. the `fox.so` file) for Windows, which made it unusable on most Windows installations. This problem was related to an incompatibility between the versions of Cygwin that I was using to compile FOX and FXRuby, and the version used to compile the standard Ruby 1.6.2 distribution for Windows. Many, many thanks to Pete, Bene and Robert for helping me to test and resolve this issue!

- Added support for FOX data targets, as demonstrated by the new `datatarget.rb` example in the `examples` directory. A data target is a special kind of FOX object that can be designated as the message target of any widget that has an associated "value", and then the value of the data target and that widget become automatically linked to each other. For example, you can create a data target with a string value and then make it the message target for an `FXTextField` widget. From then on, changes made to the text field will be automatically reflected in the data target's value and vice versa. (For those familiar with Tk, this is the same principal as its `TkVariable` class.)

- Made the `extconf.rb` script a lot more intelligent and robust. Now, if you don't explicitly specify the `--with-fox-include` and `--with-fox-lib` arguments it will look in the standard FOX installation locations (`/usr/local/include/fox` and `/usr/local/lib`, respectively). If it doesn't find the appropriate files there either, it will stop with an error message. The new `extconf.rb` script also compares the FOX version number from the FOX's `fxver.h` file to be sure it's consistent with the version of FXRuby that you're building.

- Revived the missing `FXApp#addTimeout` and `FXApp#removeTimeout` methods, which accidentally got clobbered in the 0.99.166 release.

- Corrected the implementation of `FXWindow#getCursorPosition`. Previously it thought it needed three inputs when in fact it doesn't; this method takes no arguments and returns a 3-element array containing the current `x` and `y` positions (in local window coordinates) and a flag indicating the mouse button states.

- Corrected the implementation of `FXDebugTarget.messageTypeName` to return an array of strings instead of an array of symbols (IDs).

- Added missing wrappers for the `FXJPEGImage` and `FXJPEGIcon` classes; somehow these got overlooked previously.

- Corrected several bugs in the example programs `groupbox.rb`, `imageviewer.rb` and `table.rb`.

## Changes Since Version 0.99.161

- In previous releases of FXRuby, not all of the constructor arguments for some class constructors were exposed; this was due to an obscure problem with how SWIG generated code for functions with more than nine default arguments. This problem has been corrected and all class constructor argument lists should now be consistent with the C++ library versions of the same.

- Corrected several bugs related to the conversions between FOX's FXbool (boolean) type and Ruby's `true` and `false` values. These bugs manifested themselves in many weird and wonderful ways; the most obvious one was the way that opening up pulldown menus (for example, in the `foursplit.rb` example) would cause the entire program to lock up. If you were seeing some unusual behavior like this in the previous release my best advice is to see if you can still reproduce the problem (and if so, contact me).

- Added several new example programs (`dialog.rb`, `dirlist.rb`, `groupbox.rb`, `header.rb`, `imageviewer.rb`, `tabbook.rb` and `table.rb`) in the `examples` subdirectory.

- Added support for the `FXFile` class' singleton methods. Most or all of this functionality is already available in Ruby's standard library but `FXFile` is included for completeness.

- Generally speaking, I corrected the (Ruby-side) implementations of a lot of functions and I believe that all of the important ones are exposed correctly. See the `ChangeLog` file for specific cases.

- Started work on tutorial documentation (in the `doc` subdirectory) but this isn't very useful yet. Plans are to beef this up considerably next time.

- Updated the API for compatibility with FOX version 0.99.166.

## Changes Since Version 0.99.147

- The code has been reworked a good deal in an effort to reduce the compile time (although more can and will be done). One part of this change was to break the extension code up into multiple files instead of a single file. The more significant change was to move a lot of inlined template function instantiations out of the FXRuby header file (`FXRuby.h`) and into a separate source code file that only needs to be compiled once. To give you an idea of the compile times after this change, I can now compile FXRuby under Cygwin-on-Win2000 in about 6 minutes (on a Pentium III-700MHz) or under Linux in about 30 minutes (on a Pentium "classic" 133MHz).

- For classes `FXHeader`, `FXIconList` and `FXList`, added support for the overloaded member functions `appendItem`, `insertItem`, `prependItem`, and `replaceItem`. For classes `FXTreeList` and `FXTreeListBox`, added support for the overloaded member functions `addItemAfter`, `addItemBefore`, `addItemFirst`, and `addItemLast`.

- Added the `header.rb` example program to demonstrate the `FXHeader` widget.

- Updated the API for compatibility with FOX version 0.99.161.

Prev | Up | Next
Chapter 7. Other Sources of Information | Home | Part II. Appendices