Chapter 10. Change History
Prev |  |

## Chapter 10. Change History

## 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 |
Chapter 9. To-do list | Home |