[Fxruby-commits] CVS: FXRuby/doc implementation.html,NONE,1.1.2.1 implementation.xml,NONE,1.1.2.1 bo
Status: Inactive
Brought to you by:
lyle
From: Lyle J. <ly...@us...> - 2002-05-10 17:22:06
|
Update of /cvsroot/fxruby/FXRuby/doc In directory usw-pr-cvs1:/tmp/cvs-serv16449 Modified Files: Tag: release10 book.html book.xml changes.html changes.xml library.html todo.html tutorial1.html Added Files: Tag: release10 implementation.html implementation.xml Log Message: Added a new documentation section --- NEW FILE: implementation.html --- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Chapter 9. Implementation</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="previous" href="library.html" title="Chapter 8. The FXRuby Standard Library"><link rel="next" href="todo.html" title="Chapter 10. To-do list"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 9. Implementation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="library.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="todo.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="implementation"></a>Chapter 9. Implementation</h2></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e1736"></a>Code Generation</h2></div></div><p>The development and maintenance of FXRuby would be almost impossible without the help of Dave Beazley's excellent <a href="http://www.swig.org" target="_top">SWIG</a>. The complete set of SWIG interface files used to generate FXRuby is included in the standard FXRuby source code distribution, and if you'd like you can even regenerate the FXRuby sources using SWIG. Because FXRuby relies on functionality in the latest development version of SWIG, you will need to check out that version from the SWIG CVS repository. For instructions on how to do so, please see <a href="http://www.swig.org/cvs.html" target="_top"> this page</a>.</p><p>To regenerate the FXRuby sources from the SWIG interface files, change directories to the <tt>swig-interfaces </tt> subdirectory of the FXRuby source tree and type <b>make </b>. Any time that you make a change to the SWIG interface files, you'll need to repeat this step to update the C++ sources.</p></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e1755"></a>Object Life Cycles and Garbage Collection</h2></div></div><p>One of the more difficult issues to deal with was understanding the "life cycle" of FOX objects (that is, the actual C++ objects) and their relationship to the associated Ruby instances. Understanding this relationship is critical when dealing with Ruby's garbage collector, to ensure that objects are disposed of at the right time.</p><p>For our purposes, we can divide the set of all objects in an FXRuby program into two groups, those objects that Ruby "owns" and those that it doesn't. The first group (the "owned" objects) includes those that you create explicitly from Ruby code. This is usually done by calling a class' <tt>new</tt> method, e.g.</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">myIcon = FXPNGIcon.new(myApp, File.open("icon.png", "rb").read) myButton = FXButton.new(parentWin, "Hello, World!", myIcon)</pre></td></tr></table><p>It's important to keep in mind that when you create an object like this you're not only creating the Ruby instance part (i.e. whatever overhead is usually associated with a Ruby instance) but a C++ FOX object as well. Because we created these objects, we would reasonably expect them to be destroyed when they are garbage-collected so that our programs don't leak memory.</p><p>The other group of objects (those not owned by Ruby) are those returned from most class instance methods; they are references to already- existing objects. For example, <tt>FXStatusBar#statusline </tt> returns a reference to the status bar's enclosed status line instance.</p></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e1774"></a>Virtual Functions</h2></div></div><p>One of my design requirements for FXRuby was to ensure that any virtual function calls made on a FOX object (from the C++ library layer) are routed to the proper Ruby instance method, even if that method has been overridden in a derived class.</p><p>For example, many of the FXRuby example programs are structured with a main window class that subclasses <tt>FXMainWindow</tt> and then overrides its <tt>create</tt> instance method. This <tt> create</tt> method isn't called directly from Ruby code, however; it's called as a side effect of calling <tt>FXApp#create</tt>. Inside the C++ FOX library, the <tt>FXApp::create()</tt> member function recursively calls <tt>create()</tt> on all of the application's windows and eventually calls the virtual <tt>FXMainWindow::create()</tt> member function as well. To ensure that our main window's overridden <tt>create </tt> method is invoked instead of the base class implementation, we obviously need some special machinery in place.</p><p>For every C++ class that declares virtual member functions, we derive a new C++ class that overrides all of those virtual functions with special stubs that know how to make method calls on Ruby instances. The naming convention for these classes is that the "FX" prefix is replaced with "FXRb"; for example, our <tt>FXRbButton</tt> C++ class is derived from FOX's <tt>FXButton</tt>. Although the implementation of these "stubs" varies from function to function, the basic requirements are always the same: </p><div class="orderedlist"><ol type="1"><li><p>Look up the Ruby object associated with this C++ object.</p></li><li><p>Convert each of the function's arguments to their Ruby representation. For example, arguments of type FXint are converted to Ruby <tt>Fixnum</tt>s.</p></li><li><p>Call the Ruby object's method, using the <tt> rb_funcall()</tt> function from Ruby's C API, and capture its result (which is itself a Ruby object).</p></li><li><p>Convert the method call's result back to the virtual function's C++ return type, and then return that result from the C++ function. For example, if the C++ function has a FXbool return type, we would expect the corresponding Ruby method to return either <tt>Qtrue</tt> or <tt>Qfalse</tt>.</p></li></ol></div><p> </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="library.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="book.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="todo.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 8. The FXRuby Standard Library </td><td width="20%" align="center"><a accesskey="h" href="book.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 10. To-do list</td></tr></table></div></body></html> --- NEW FILE: implementation.xml --- <chapter id="implementation"> <title>Implementation</title> <simplesect> <title>Code Generation</title> <para>The development and maintenance of FXRuby would be almost impossible without the help of Dave Beazley's excellent <ulink url="http://www.swig.org">SWIG</ulink>. The complete set of SWIG interface files used to generate FXRuby is included in the standard FXRuby source code distribution, and if you'd like you can even regenerate the FXRuby sources using SWIG. Because FXRuby relies on functionality in the latest development version of SWIG, you will need to check out that version from the SWIG CVS repository. For instructions on how to do so, please see <ulink url="http://www.swig.org/cvs.html"> this page</ulink>.</para> <para>To regenerate the FXRuby sources from the SWIG interface files, change directories to the <filename class="directory">swig-interfaces </filename> subdirectory of the FXRuby source tree and type <command>make </command>. Any time that you make a change to the SWIG interface files, you'll need to repeat this step to update the C++ sources.</para> </simplesect> <simplesect> <title>Object Life Cycles and Garbage Collection</title> <para>One of the more difficult issues to deal with was understanding the "life cycle" of FOX objects (that is, the actual C++ objects) and their relationship to the associated Ruby instances. Understanding this relationship is critical when dealing with Ruby's garbage collector, to ensure that objects are disposed of at the right time.</para> <para>For our purposes, we can divide the set of all objects in an FXRuby program into two groups, those objects that Ruby "owns" and those that it doesn't. The first group (the "owned" objects) includes those that you create explicitly from Ruby code. This is usually done by calling a class' <methodname>new</methodname> method, e.g.</para> <programlisting format="linespecific">myIcon = FXPNGIcon.new(myApp, File.open("icon.png", "rb").read) myButton = FXButton.new(parentWin, "Hello, World!", myIcon)</programlisting> <para>It's important to keep in mind that when you create an object like this you're not only creating the Ruby instance part (i.e. whatever overhead is usually associated with a Ruby instance) but a C++ FOX object as well. Because we created these objects, we would reasonably expect them to be destroyed when they are garbage-collected so that our programs don't leak memory.</para> <para>The other group of objects (those not owned by Ruby) are those returned from most class instance methods; they are references to already- existing objects. For example, <methodname>FXStatusBar#statusline </methodname> returns a reference to the status bar's enclosed status line instance.</para> </simplesect> <simplesect> <title>Virtual Functions</title> <para>One of my design requirements for FXRuby was to ensure that any virtual function calls made on a FOX object (from the C++ library layer) are routed to the proper Ruby instance method, even if that method has been overridden in a derived class.</para> <para>For example, many of the FXRuby example programs are structured with a main window class that subclasses <classname>FXMainWindow</classname> and then overrides its <methodname>create</methodname> instance method. This <methodname> create</methodname> method isn't called directly from Ruby code, however; it's called as a side effect of calling <methodname>FXApp#create</methodname>. Inside the C++ FOX library, the <methodname>FXApp::create()</methodname> member function recursively calls <methodname>create()</methodname> on all of the application's windows and eventually calls the virtual <methodname>FXMainWindow::create()</methodname> member function as well. To ensure that our main window's overridden <methodname>create </methodname> method is invoked instead of the base class implementation, we obviously need some special machinery in place.</para> <para>For every C++ class that declares virtual member functions, we derive a new C++ class that overrides all of those virtual functions with special stubs that know how to make method calls on Ruby instances. The naming convention for these classes is that the "FX" prefix is replaced with "FXRb"; for example, our <classname>FXRbButton</classname> C++ class is derived from FOX's <classname>FXButton</classname>. Although the implementation of these "stubs" varies from function to function, the basic requirements are always the same: <orderedlist> <listitem><para>Look up the Ruby object associated with this C++ object.</para></listitem> <listitem><para>Convert each of the function's arguments to their Ruby representation. For example, arguments of type <type>FXint</type> are converted to Ruby <classname>Fixnum</classname>s.</para></listitem> <listitem><para>Call the Ruby object's method, using the <function> rb_funcall()</function> function from Ruby's C API, and capture its result (which is itself a Ruby object).</para></listitem> <listitem><para>Convert the method call's result back to the virtual function's C++ return type, and then return that result from the C++ function. For example, if the C++ function has a <type> FXbool</type> return type, we would expect the corresponding Ruby method to return either <constant>Qtrue</constant> or <constant>Qfalse</constant>.</para></listitem> </orderedlist> </para> </simplesect> </chapter> Index: book.html =================================================================== RCS file: /cvsroot/fxruby/FXRuby/doc/book.html,v retrieving revision 1.35.2.1 retrieving revision 1.35.2.2 diff -C2 -d -r1.35.2.1 -r1.35.2.2 *** book.html 30 Apr 2002 19:42:23 -0000 1.35.2.1 --- book.html 10 May 2002 17:22:02 -0000 1.35.2.2 *************** *** 1,3 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Developing Graphical User Interfaces with FXRuby</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="next" href="goals.html" title="History and Goals"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Developing Graphical User Interfaces with FXRuby</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="goals.html">Next</a></td></tr></table><hr></div><div class="book"><div class="titlepage"><div><h1 class="title"><a name="book"></a>Developing Graphical User Interfaces with FXRuby</h1></div><div><div class="author"><h3 class="author">Lyle Johnson</h3></div></div><div><p class="copyright">Copyright © 2001 J. Lyle Johnson</p></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="goals.html">History and Goals</a></dt><dt>1. <a href="build.html">Building from Source Code</a></dt><dt>2. <a href="examples.html">Examples</a></dt><dt>3. <a href="tutorial1.html">Hello, World!</a></dt><dt>4. <a href="opengl.html">Using OpenGL with FXRuby</a></dt><dt>5. <a href="scintilla.html">Using Scintilla with FXRuby</a></dt><dt>6. <a href="differences.html">Differences between FOX and FXRuby</a></dt><dt>7. <a href="events.html">FXRuby's Message-Target System</a></dt><dt>8. <a href="library.html">The FXRuby Standard Library</a></dt><dt>9. <a href="todo.html">To-do list</a></dt><dt>10. <a href="changes.html">Change History</a></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="goals.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> History and Goals</td></tr></table></div></body></html> \ No newline at end of file --- 1,3 ---- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Developing Graphical User Interfaces with FXRuby</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="next" href="goals.html" title="History and Goals"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Developing Graphical User Interfaces with FXRuby</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="goals.html">Next</a></td></tr></table><hr></div><div class="book"><div class="titlepage"><div><h1 class="title"><a name="book"></a>Developing Graphical User Interfaces with FXRuby</h1></div><div><div class="author"><h3 class="author">Lyle Johnson</h3></div></div><div><p class="copyright">Copyright © 2001 J. Lyle Johnson</p></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="goals.html">History and Goals</a></dt><dt>1. <a href="build.html">Building from Source Code</a></dt><dt>2. <a href="examples.html">Examples</a></dt><dt>3. <a href="tutorial1.html">Hello, World!</a></dt><dt>4. <a href="opengl.html">Using OpenGL with FXRuby</a></dt><dt>5. <a href="scintilla.html">Using Scintilla with FXRuby</a></dt><dt>6. <a href="differences.html">Differences between FOX and FXRuby</a></dt><dt>7. <a href="events.html">FXRuby's Message-Target System</a></dt><dt>8. <a href="library.html">The FXRuby Standard Library</a></dt><dt>9. <a href="implementation.html">Implementation</a></dt><dt>10. <a href="todo.html">To-do list</a></dt><dt>11. <a href="changes.html">Change History</a></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="goals.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> History and Goals</td></tr></table></div></body></html> \ No newline at end of file Index: book.xml =================================================================== RCS file: /cvsroot/fxruby/FXRuby/doc/book.xml,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** book.xml 14 Mar 2002 17:03:39 -0000 1.7 --- book.xml 10 May 2002 17:22:03 -0000 1.7.2.1 *************** *** 10,13 **** --- 10,14 ---- <!ENTITY events.xml SYSTEM "events.xml"> <!ENTITY goals.xml SYSTEM "goals.xml"> + <!ENTITY implementation.xml SYSTEM "implementation.xml"> <!ENTITY library.xml SYSTEM "library.xml"> <!ENTITY opengl.xml SYSTEM "opengl.xml"> *************** *** 27,30 **** --- 28,32 ---- &events.xml; &library.xml; + &implementation.xml; &todo.xml; &changes.xml; Index: changes.html =================================================================== RCS file: /cvsroot/fxruby/FXRuby/doc/changes.html,v retrieving revision 1.42.2.1 retrieving revision 1.42.2.2 diff -C2 -d -r1.42.2.1 -r1.42.2.2 *** changes.html 30 Apr 2002 19:42:23 -0000 1.42.2.1 --- changes.html 10 May 2002 17:22:03 -0000 1.42.2.2 *************** *** 1,5 **** <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 10. Change History</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="previous" href="todo.html" title="Chapter 9. To-do list"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 10. Change History</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="todo.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="changes"></a>Chapter 10. Change History</h2></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e1798"></a>Changes Since Version 1.0.3</h2></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Corrected the code for <tt>FXTreeList#clearItems</tt> 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.</p></li><li style="list-style-type: disc"><p>The API for Ruby's <tt>rb_rescue2()</tt> 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.</p></li><li style="list-style-type: disc"><p>The <tt>FXApp#enableThreads</tt> and <tt>FXApp#disableThreads</tt> instance methods have been replaced by a single instance method, --- 1,5 ---- <html><head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> ! <title>Chapter 11. Change History</title><meta name="generator" content="DocBook XSL Stylesheets V1.50.0"><link rel="home" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="up" href="book.html" title="Developing Graphical User Interfaces with FXRuby"><link rel="previous" href="todo.html" title="Chapter 10. To-do list"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 11. Change History</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="todo.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> </td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><h2 class="title"><a name="changes"></a>Chapter 11. Change History</h2></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e1910"></a>Changes Since Version 1.0.3</h2></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Corrected the code for <tt>FXTreeList#clearItems</tt> 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.</p></li><li style="list-style-type: disc"><p>The API for Ruby's <tt>rb_rescue2()</tt> 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.</p></li><li style="list-style-type: disc"><p>The <tt>FXApp#enableThreads</tt> and <tt>FXApp#disableThreads</tt> instance methods have been replaced by a single instance method, *************** *** 8,12 **** Also added a new instance method, <tt>FXApp#threadsEnabled?</tt>, ! which returns the current value for this setting.</p></li><li style="list-style-type: disc"><p>The <tt>FXToolbar#dock</tt> instance method could crash if the default value of <tt>nil</tt> was used for the second argument (see SourceForge Bug #550417). This has been fixed.</p></li><li style="list-style-type: disc"><p>Calls to <tt>FXFileDialog.getOpenFilename</tt> 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.</p></li><li style="list-style-type: disc"><p>Added input typemaps for <tt>FXVec</tt> and <tt>FXHVec</tt>, such that any method which expects one of these types as input will also accept a Ruby array of the same size. --- 8,12 ---- Also added a new instance method, <tt>FXApp#threadsEnabled?</tt>, ! which returns the current value for this setting.</p></li><li style="list-style-type: disc"><p>The <tt>FXToolbar#dock</tt> instance method could crash if the default value of <tt>nil</tt> was used for the second argument (see <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=550417&group_id=20243&atid=120243" target="_top">SourceForge Bug #550417</a>). This has been fixed.</p></li><li style="list-style-type: disc"><p>Calls to <tt>FXFileDialog.getOpenFilename</tt> could crash if the fourth argument's default value was used instead of explicitly specifying its value (see <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=550349&group_id=20243&atid=120243" target="_top">SourceForge Bug #550349</a>). This has been fixed.</p></li><li style="list-style-type: disc"><p>Added input typemaps for <tt>FXVec</tt> and <tt>FXHVec</tt>, such that any method which expects one of these types as input will also accept a Ruby array of the same size. *************** *** 14,16 **** now be called in either of these equivalent forms:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">glviewer.backgroundColor = FXHVec.new(0.5, 0.5, 0.5, 1.0)</pre></td></tr></table> or ! <table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">glviewer.backgroundColor = [0.5, 0.5, 0.5, 1.0]</pre></td></tr></table></li><li style="list-style-type: disc"><p>Updated the test case for <tt>FXMaterial</tt>, added a new test case for <tt>FXFileStream</tt>.</p></li><li style="list-style-type: disc"><p>Added aliases <tt>posVisible?</tt> (for <tt>FXTextField#isPosVisible</tt>), <tt>posSelected?</tt> (for <tt>FXTextField#isPosSelected</tt>), <tt>itemCurrent?</tt> (for <tt>FXComboBox#isItemCurrent</tt>), <tt>hasAccel?</tt> (for <tt>FXAccelTable#hasAccel</tt>), <tt>error=</tt> (for <tt>FXStream#setError</tt>), <tt>position=</tt> (for <tt>FXStream#setPosition</tt>) and <tt>position</tt> (for <tt>FXStream#getPosition</tt>).</p></li><li style="list-style-type: disc"><p>The <tt>FXStream</tt>, <tt>FXFileStream</tt> and <tt>FXMemoryStream</tt> 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.</p></li><li style="list-style-type: disc"><p>Did some more work on completing the <tt>FXDC</tt> interface, including adding a test case for the same.</p></li><li style="list-style-type: disc"><p>All GIF image files have now been replaced with PNG equivalents. For more information on why this is a good idea, see <a href="http://burnallgifs.org" target="_top">this site</a>.</p></li></ul></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e1939"></a>Changes Since Version 0.99.189</h2></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Upgraded to the latest version of Minero Aoki's <tt>install.rb</tt> script.</p></li><li style="list-style-type: disc"><p>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.</p></li><li style="list-style-type: disc"><p>Improved support for customized sorting of list items for the <tt>FXComboBox</tt>, <tt>FXIconList</tt>, <tt>FXList</tt>, <tt>FXListBox</tt>, <tt>FXTreeList</tt> and <tt>FXTreeListBox</tt> 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 <tt><=></tt> method to compare one list item to another. Thanks to Martin Stannard for prompting me to resolve this problem.</p></li><li style="list-style-type: disc"><p>Added instructions about how to modify your <tt>/etc/ld.so.conf</tt> file (on Linux) to include the <tt>libFOX.so</tt> installation directory. Thanks to Giuseppe Cacopardo for providing this information.</p></li><li style="list-style-type: disc"><p>Updated the test cases (again) for use with Nathaniel Talbott's <a href="http://testunit.talbott.ws" target="_top">TestUnit</a>, which is apparently the successor to Lapidary.</p></li><li style="list-style-type: disc"><p>Added support for the <tt>FXCURCursor</tt>, <tt>FXRGBIcon</tt>, <tt>FXRGBImage</tt> classes.</p></li><li style="list-style-type: disc"><p>Fixed a longstanding bug related to the ownership (for garbage collection purposes) of <tt>FXGLGroup</tt> and <tt>FXGLShape</tt> instances. This is the bug that was causing the <tt>glviewer.rb</tt> example program to crash on exit.</p></li><li style="list-style-type: disc"><p>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 <tt>FXEvent</tt> 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.</p></li><li style="list-style-type: disc"><p>Added some safeguards for "destructive" functions like <tt>FXList#clearItems</tt>, 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.</p></li><li style="list-style-type: disc"><p>Performed a major overhaul on the <tt>shutter.rb</tt> example program, which still demonstrates the <tt>FXShutter</tt> widget but otherwise doesn't resemble its previous incarnation at all.</p></li><li style="list-style-type: disc"><p>Added a new example program (<tt>raabrowser.rb</tt>) that allows you to browse the Ruby Application Archive via its SOAP interface. Requires the <a href="http://www.jin.gr.jp/~nahi/Ruby/SOAP4R" target="_top">SOAP4R</a> extension.</p></li><li style="list-style-type: disc"><p>Added a new example program (<tt>babelfish.rb</tt>) that allows you to use the Babelfish translator web service via its SOAP interface. Requires the <a href="http://www.jin.gr.jp/~nahi/Ruby/SOAP4R" target="_top">SOAP4R</a> extension.</p></li><li style="list-style-type: disc"><p>Added a new page to the documentation to briefly describe each of the example programs (including screenshots).</p></li><li style="list-style-type: disc"><p>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 <a href="http://sourceforge.net/cvs/?group_id=20243" target="_top">SourceForge project CVS page</a>.</p></li><li style="list-style-type: disc"><p>Updated the interfaces for compatibility with <a href="http://www.fox-toolkit.org/ftp/fox-1.0.3.tar.gz" target="_top">fox-1.0.3</a>.</p></li></ul></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e2069"></a>Changes Since Version 0.99.188</h2></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Fixed a big bug related to the <tt>FXApp#addSignal</tt> and <tt>FXApp#removeSignal</tt> 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 <tt>Process::kill</tt> when the signal name is unrecognized or the argument type is wrong.</p></li><li style="list-style-type: disc"><p>The <tt>imageviewer.rb</tt> example program now supports loading TARGA, ICO and TIFF image files.</p></li><li style="list-style-type: disc"><p>The configuration process on Windows should now detect the presence of <tt>libtiff.lib</tt> properly.</p></li><li style="list-style-type: disc"><p>Updated the interfaces for compatibility with <a href="http://www.fox-toolkit.org/ftp/fox-0.99.189.tar.gz" target="_top">fox-0.99.189</a>.</p></li></ul></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e2103"></a>Changes Since Version 0.99.181</h2></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Removed the <tt>-fno-strict-prototype</tt> and <tt>-fpermissive</tt> flags from the <tt>CFLAGS</tt> for Linux builds, since these two flags are no longer supported for more recent versions of gcc. Thanks to Thomas Lundqvist for reporting this.</p></li><li style="list-style-type: disc"><p>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.</p></li><li style="list-style-type: disc"><p>Updated the FXRuby test cases (such as they are) to use Nathaniel Talbott's <a href="http://lapidary.sourceforge.net" target="_top">Lapidary</a> unit testing framework.</p></li><li style="list-style-type: disc"><p>Migrated yet more code from the C++ extension to pure Ruby versions. Most of the code for the <tt>FXPoint</tt>, <tt>FXRectangle</tt> and <tt>FXSize</tt> classes is now implemented in Ruby.</p></li><li style="list-style-type: disc"><p>Fixed a bug in the <tt>browser.rb</tt> example. I had meant for the methods and constants lists to be sorted but had failed to use the in-place <tt>sort!</tt> method. Thanks to Robert Gustavsson for reporting this.</p></li><li style="list-style-type: disc"><p>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.</p></li><li style="list-style-type: disc"><p>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.</p></li><li style="list-style-type: disc"><p>For fun, added a new example program that downloads today's Dilbert cartoon from the <a href="http://www.dilbertzone.com" target="_top">DilbertZone</a> web site and displays it in an <tt>FXImageViewer</tt> widget. Requires the <tt>html-parser</tt> module, listed in the <a href="http://www.ruby-lang.org/en/raa.html" target="_top">Ruby Application Archive</a>.</p></li><li style="list-style-type: disc"><p>Updated the interfaces for compatibility with <a href="http://www.fox-toolkit.org/ftp/fox-0.99.188.tar.gz" target="_top">fox-0.99.188</a>.</p></li></ul></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e2176"></a>Changes Since Version 0.99.180</h2></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Added <tt>slices</tt>, <tt>stacks</tt> and <tt>loops</tt> accessors for the <tt>FXGLCone</tt> and <tt>FXGLCylinder</tt> classes, to provide finer control over the rendering fidelity for these shapes (this was already done for <tt>FXGLSphere</tt> in the previous release).</p></li><li style="list-style-type: disc"><p>Updated the interfaces for compatibility with <a href="ftp://ftp.fox-toolkit.org/pub/fox-0.99.181.tar.gz" target="_top">fox-0.99.181</a>.</p></li></ul></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e2207"></a>Changes Since Version 0.99.174</h2></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Moved the class definitions for <tt>FXGLPoint</tt>, <tt>FXGLLine</tt>, <tt>FXGLCube</tt>, <tt>FXGLCylinder</tt>, <tt>FXGLSphere</tt> and <tt>FXGLCone</tt> to a new library module <tt>fox/glshapes.rb</tt>. 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 <tt>examples/glviewer.rb</tt> for an example of their use.</p></li><li style="list-style-type: disc"><p>Fixed a bug related to object ownership for GL objects added to a <tt>FXGLGroup</tt>.</p></li><li style="list-style-type: disc"><p>Added support for overriding the virtual <tt>layout</tt> method in classes derived from <tt>FXWindow</tt>. This will allow developers to, for example, develop new kinds of layout managers.</p></li><li style="list-style-type: disc"><p>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.</p></li><li style="list-style-type: disc"><p>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 <tt>install.rb</tt> instead of <tt>setup.rb</tt>.</p></li><li style="list-style-type: disc"><p>Added the <tt>colors.rb</tt> library file, for predefined color names in the <tt>FXColor</tt> namespace. The use of this module allows you to use symbolic names like <tt>FXColor::Red</tt> instead of an RGB constant like FXRGB(255, 0, 0). Many thanks to Jeff Heard for this suggestion and the contributed file.</p></li><li style="list-style-type: disc"><p>The <tt>FXRegion</tt> was accidentally being renamed to <tt>FX_Region</tt> (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.</p></li><li style="list-style-type: disc"><p>The <tt>FXFileStream</tt> class now supports a Ruby-style <tt>open</tt> singleton method that provides transactional control for closing the file stream when it's done. See the <tt>image.rb</tt> and <tt>imageviewer.rb</tt> examples for how this works.</p></li><li style="list-style-type: disc"><p>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 <a href="http://www.rubygarden.org/ruby?FXRubyComments" target="_top">this page</a> on the RubyGarden Wiki.</p></li><li style="list-style-type: disc"><p>Added support for the <tt>each_row</tt> and <tt>each_column</tt> iterators for the <tt>FXTable</tt> class. These iterators yield an array of references to <tt>FXTableItem</tt> instances, one per row or column, respectively. Note that the <tt>each</tt> method is just an alias for <tt>each_row</tt>.</p></li><li style="list-style-type: disc"><p>Removed the interfaces for <tt>fxrandom</tt>, <tt>fxmalloc</tt>, <tt>fxcalloc</tt>, <tt>fxresize</tt>, <tt>fxmemdump</tt>, and <tt>fxfree</tt>. These utility functions are not relevant for FXRuby.</p></li><li style="list-style-type: disc"><p>Corrected interfaces for <tt>fxhsv_to_rgb</tt> and <tt>fxrgb_to_hsv</tt> so that they return three-element arrays of the converted color components.</p></li><li style="list-style-type: disc"><p>Corrected interfaces for <tt>FXWindow#acquireSelection</tt>, <tt>FXWindow#acquireClipboard</tt> and <tt>FXWindow#beginDrag</tt> to take an array of drag types.</p></li><li style="list-style-type: disc"><p>Corrected interfaces for <tt>fxsaveBMP</tt>, <tt>fxsaveGIF</tt>, <tt>fxsaveICO</tt>, <tt>fxsavePCX</tt>, <tt>fxsavePNG</tt>, <tt>fxsaveTIF</tt> and <tt>fxsaveXPM</tt> so that they expect a Ruby string (containing the image pixel data) as their second argument.</p></li><li style="list-style-type: disc"><p>Updated the interfaces for compatibility with <a href="ftp://ftp.fox-toolkit.org/pub/fox-0.99.180.tar.gz" target="_top">fox-0.99.180</a>.</p></li></ul></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e2400"></a>Changes Since Version 0.99.173</h2></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Moved all of the method name aliases out of the C interface code and into a new library file (<tt>fox/aliases.rb</tt>). 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 (<tt>fox/iterators.rb</tt>). The main purpose of these changes is to reduce the size of the C++ code (especially <tt>core_wrap.cpp</tt>) 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.</p></li><li style="list-style-type: disc"><p>A few errors made it into the <tt>undolist.rb</tt> library module and the <tt>textedit.rb</tt> example last time; I think these have been fixed.</p></li><li style="list-style-type: disc"><p>I meant to add support for the new <tt>FXPCXIcon</tt> and <tt>FXPCXImage</tt> 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: <tt>FXTIFIcon</tt>, <tt>F XTIFImage</tt> and <tt>FXProgressDialog</tt>.</p></li><li style="list-style-type: disc"><p>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 <tt>NULL</tt> 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.</p></li><li style="list-style-type: disc"><p>Updated the source code and <tt>extconf.rb</tt> 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!</p></li><li style="list-style-type: disc"><p>Fixed things so that the <tt>FXApp#addInput</tt> and <tt>FXApp#removeInput</tt> instance methods work properly for generating input messages. The first argument to both of these methods should be an <tt>IO</tt> object of some kind (specifically, an object that implements a <tt>fileno</tt> 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 <tt>inputs.rb</tt> program in the <tt>examples</tt> directory for an example of how this works. Thanks to Ralf Canis for reminding me that I left this broken!</p></li><li style="list-style-type: disc"><p>Completed the basic code changes required for <tt>FXObject#handle</tt> 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 <tt>FXWindow</tt>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.</p></li><li style="list-style-type: disc"><p>Updated the interfaces for compatibility with <a href="ftp://ftp.cfdrc.com/pub/FOX/fox-0.99.174.tar.gz" target="_top">fox-0.99.174</a>.</p></li></ul></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e2491"></a>Changes Since Version 0.99.172</h2></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Changed the build and installation process to use Minero Aoki's <tt>setup.rb</tt> 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.</p><p>If you have previously installed FXRuby (and written programs with the same) there are a few changes that may affect you. First, <tt>setup.rb</tt> will install the shared library (<tt>fox.so</tt>) in your <tt>site_ruby</tt> directory instead of the "core" libraries directory, where it was previously installed. So you should be sure to remove the old version of <tt>fox.so</tt> before installing and using this one.</p><p>The other change to be aware of is that there is now a <tt>fox</tt> directory containing FXRuby library scripts, and the <tt>responder.rb</tt> module is the first entry for this directory. You can import this file into your Ruby scripts with the line:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">require 'fox/responder'</pre></td></tr></table><p>and it's no longer necessary to drag copies of that file around.</p></li><li style="list-style-type: disc"><p>Aliased the <tt>getText</tt> instance method to <tt>to_s</tt> 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.</p></li><li style="list-style-type: disc"><p>Added the <tt>FXWindow#removeChild</tt> method for removing child widgets from a container window. This method doesn't exist for the C++ <tt>FXWindow</tt> 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 <tt>FXWindow#removeChild</tt> any outstanding references to the recently deceased child widget are invalid and should be set to <tt>nil</tt> or otherwise disposed of. Thanks to Ted Meng for noticing this omission.</p></li><li style="list-style-type: disc"><p>Modified some of the OpenGL method calls in <tt>gltest.rb</tt> for compatibility with Ruby/OpenGL 0.32. You should now be able to use Ruby/OpenGL with FXRuby unmodified.</p></li><li style="list-style-type: disc"><p>Added <tt>each()</tt> instance methods for <tt>FXComboBox</tt>, <tt>FXGLGroup</tt>, <tt>FXHeader</tt>, <tt>FXIconList</tt>, <tt>FXList</tt>, <tt>FXListBox</tt>, <tt>FXTreeItem</tt>, <tt>FXTreeList</tt> and <tt>FXTreeListBox</tt> in support of iterating over their sub-items. Also mixed the <tt>Enumerable</tt> module into all of these classes.</p></li><li style="list-style-type: disc"><p>Corrected the implementations of <tt>getData()</tt> and <tt>setData()</tt> for a variety of classes. You should now be able to attach arbitrary (application-defined) data to any FOX object that supports these APIs.</p></li><li style="list-style-type: disc"><p>As a debugging tool, you can now optionally catch exceptions raised in message handlers. To turn on this feature, call the <tt>setIgnoreExceptions(true)</tt> 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.</p></li><li style="list-style-type: disc"><p>Extended the interfaces for <tt>FXApp#addSignal</tt> and <tt>FXApp#removeSignal</tt> 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 <tt>Process.kill</tt> module method). For examples of how to use this, see the <tt>datatarget.rb</tt> or <tt>imageviewer.rb</tt> example programs.</p></li><li style="list-style-type: disc"><p>Corrected the implementations of <tt>fxparsefontdesc()</tt> and <tt>fxunparsefontdesc()</tt> module methods.</p></li><li style="list-style-type: disc"><p>Added a pure Ruby implementation of the standard <tt>FXCommand</tt> and <tt>FXUndoList</tt> classes from the standard FOX library.</p></li><li style="list-style-type: disc"><p>Added the <tt>splitter.rb</tt> example, to demonstrate the <tt>FXSplitter</tt> class and its options.</p></li><li style="list-style-type: disc"><p>Completed the initial version of <tt>browser.rb</tt>, 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!</p></li><li style="list-style-type: disc"><p>Corrected the constructors for <tt>FXXPMIcon</tt> and <tt>FXXPMImage</tt> 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 <tt>nil</tt> to construct an initially-empty icon or image.</p></li><li style="list-style-type: disc"><p>Corrected the message data sent by <tt>FXList</tt> to its message target for the <tt>SEL_SELECTED</tt>, <tt>SEL_DESELECTED</tt>, <tt>SEL_INSERTED</tt>, <tt>SEL_DELETED</tt>, and <tt>SEL_REPLACED</tt> messages. For each of these messages, the data should be an integer indicating the affected list item's index.</p></li><li style="list-style-type: disc"><p>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.</p></li><li style="list-style-type: disc"><p>Fixed a subtle GC bug related to object ownership. I'll use the <tt>FXList</t t> and <tt>FXListItem</tt> classes to describe the problem, but it's also relevant for several other FOX classes.</p><p>There are two ways to add a new list item to an <tt>FXList</tt> instance. One of those ways involves creating a new <tt>FXListItem</tt> instance explicitly (i.e. using <tt>FXListItem.new</tt>) and then passing it into an <tt>FXList</tt> instance method like <tt>FXList#appendItem</tt>. 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 <tt>FXListItem</tt> instance, it is appropriate to also destroy the underlying C++ object. After the list item has been added to an <tt>FXList</tt>, however, the <tt>FXList</tt> owns that list item and is responsible for destroying it.</p><p>This bug became an issue when you added <tt>FXListItem</tt> instances to a list, because the code didn't properly recognize the fact that "ownership" of the list item had been transferred from the <tt>FXListItem</tt> instance to the <tt>FXList</tt>. More to the point, Ruby's garbage collector assumed that it was still OK to destroy the <tt>FXListItem</tt> instances that it knew about, and so objects could get deleted twice. This would usually result in a core dump.</p><p>Many thanks to Albert Wagner for submitting an example program that demonstrated this problem.</p></li><li style="list-style-type: disc"><p>Updated the interfaces for compatibility with <a href="ftp://ftp.fox-toolkit.org/pub/fox-0.99.173.tar.gz" target="_top">fox-0.99.173</a>.</p></li></ul></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e2755"></a>Changes Since Version 0.99.167</h2></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Completed the coding for "safe" coexistence with Ruby's garbage collector; it should no longer be necessary to call <tt>GC.disable</tt> 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 <tt>GC.disable</tt> to the top to see if it fixes things. If this does make a difference, <span class="emphasis"><em>please</em></span> send me the program (or another that reproduces the problem) so I can track down what's going wrong.</p></li><li style="list-style-type: disc"><p>Added aliases for all classes' accessor functions so that the related properties can be accessed more directly; for example, <tt>FXLabel#getText</tt> is aliased to <tt>FXLabel#text</tt> and <tt>FXLabel#setText</tt> is aliased to <tt>FXLabel#text=</tt>. 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:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aLabel.setText(aLabel.getText() + " (modified)")</pre></td></tr></table><p>and this version of the same, now using the propery accessor functions:</p><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting">aLabel.text += " (modified)"</pre></td></tr></table><p>None of the standard FOX class APIs have been removed, so you shouldn't need to modify any already-working code.</p></li><li style="list-style-type: disc"><p>Corrected the message data sent from the <tt>FXText</tt> widget to its message target for the <tt>SEL_SELECTED</tt>, <tt>SEL_DESELECTED</tt>, <tt>SEL_INSERTED</tt>, <tt>SEL_DELETED</tt> and <tt>SEL_REPLACED</tt> 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 <tt>SEL_REPLACED</tt> 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.</p></li><li style="list-style-type: disc"><p>Updated the interfaces for compatibility with <a href="ftp://ftp.fox-toolkit.org/pub/fox-0.99.172.tar.gz" target="_top">fox-0.99.172</a>.</p></li></ul></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e2824"></a>Changes Since Version 0.99.166-1</h2></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Corrected the interfaces for <tt>FXInputDialog.getString</tt>, <tt>FXInputDialog.getReal</tt> and <tt>FXInputDialog.getInteger</tt> to either return the requested type or <tt>nil</tt> if the user cancels the dialog.</p></li><li style="list-style-type: disc"><p>Added code at the top of all the examples to disable Ruby's garbage collector, until the issues with GC are resolved.</p></li><li style="list-style-type: disc"><p>Corrected implementations for the overloaded versions of <tt>FXWindow#update</tt>. 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.</p></li><li style="list-style-type: disc"><p>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 (<tt>Fixnum</tt>, <tt>Bignum</tt> or <tt>Float</tt>) 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 <tt>false</tt> and <tt>true</tt> to zero and one, respectively. For any other return type (<tt>nil</tt>, strings, etc.) we just assume they meant to return 1. Thanks to Ted Meng for this suggestion.</p></li><li style="list-style-type: disc"><p>Modified the interfaces for <tt>FXFileDialog#getPatternList</tt>, <tt>FXFileSelector#getPatternList</tt>, <tt>FXFileDialog#setPatternList</tt> and <tt>FXFileSelector#setPatternList</tt> 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 <tt>imageviewer.rb</tt> example program.</p></li><li style="list-style-type: disc"><p>Added the FOX key cap definitions (i.e. the symbols from <tt>fxkeys.h</tt>) into FXRuby. Thanks to Benedikt Grundmann for pointing out this omission.</p></li><li style="list-style-type: disc"><p>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 <tt>groupbox.rb</tt> 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.</p><p>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 <tt>FXApp</tt> object's <i><tt>sleepTime</tt></i> attribute. The default value for <i><tt>FXApp#sleepTime</tt></i> is 100 milliseconds. You can also disable the threads support completely by calling <tt>FXApp#disableThreads</tt> (and subsequently re-enable it with <tt>FXApp#enableThreads</tt>.</p></li><li style="list-style-type: disc"><p>Started adding <a href="http://homepage1.nifty.com/markey/ruby/rubyunit/index_e.html" target="_top">RubyUnit</a>-style test cases to the <tt>tests</tt> subdirectory. There's not much there yet but we've got to start somewhere!</p></li><li style="list-style-type: disc"><p>Converted most of the documentation over to <a href="http://www.docbook.org" target="_top">DocBook</a> format and reorganized the web page accordingly.</p></li> <li style="list-style-type: disc"><p>Updated the interfaces for compatibility with <a href="ftp://ftp.cfdrc.com/pub/FOX/fox-0.99.167.tar.gz" target="_top">fox-0.99.167</a>.</p></li></ul></div></div><div class="simplesect"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e2941"></a>Changes Since Version 0.99.166</h2></div></div><div class="itemizedlist"><ul type="bullet"><li style="list-style-type: disc"><p>Corrected a problem with the binary distribution (i.e. the <tt>fox.so</tt> 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!</p></li><li style="list-style-type: disc"><p>Added support for FOX data targets, as demonstrated by the new <tt>datatarget.rb</tt> example in the <tt>examples</tt> 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 <tt>FXTextField</tt> 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 <tt>TkVariable</tt> class.)</p></li><li style="list-style-type: disc"><p>Made the <tt>extconf.rb</tt> script a lot more intelligent and robust. Now,... [truncated message content] |