Chapter 9. To-do list
Prev |  | Next

## Chapter 9. To-do list

- There are several closely related (but different) problems related to how message data is passed back and forth between the C++ and Ruby layers of FOX and FXRuby. The first case has to do with invoking a message handler function on a Ruby instance of a FOX class. Since FOX packages its message data as a void pointer, FXRuby must convert that data into something that Ruby understands. For example, if the sender of the message is an `FXButton` and the message type is `SEL_COMMAND`, the message data is an unsigned integer indicating the button state. This case is already handled correctly (as far as I know).

  The second case has to do with calling message handler functions (e.g. `FXTextField#onKeyPress`) directly. This typically happens when you've subclassed an existing widget (like `FXTextField`) and added your own code to handle a message (like `SEL_KEYPRESS`). Just as with overriding base class methods in general, you may want to first call the base class message handler and then add your own customizations. For this to work properly, we must again correctly convert the Ruby message data back into a void pointer that the C++ code understands. The FXRuby code for this case is also complete.

  The last case is sort-of the inverse of the first case; it's when you call the `FXObject#handle` on a Ruby instance. In this case, if the call bubbles all the way back up to the C++ code layer we need to convert the accompanying message data from a Ruby instance back into a void pointer to the appropriate type. This case is partially handled, and is still a high development priority. To get an idea of which message types and identifiers are currently working, see the function `FXRbGetExpectedData` in the C++ source file `ext/fox/FXRuby.cpp`.

- At this early stage of development, I haven't even begun to consider some of the more esoteric issues such as multithreaded applications, or interactions with other popular Ruby extensions. When FXRuby itself is basically "stable" (whatever that means) I'll be able to take the time to study those kinds of things, so please be patient until then ;)

- Many of the member functions for FOX classes are overloaded and so these require some special treatment in Ruby, where function overloading isn't supported in quite the same way as it is in C++. I am gradually working my way through these cases and eventually all of them will work properly. In the meantime, please let me know if you have a specific question about how to call certain functions.

- More examples are always good. Instead of (or in addition to) merely cloning the C++ examples from the standard FOX distribution, it would be nice to have some original example programs that demonstrate Ruby's special strengths.

- The standard FOX header files include specially-formatted comments that DOC++ can use to automatically generate HTML documentation. With a clever Ruby script, this documentation could probably be extracted from the FOX header files and converted into ri-style documentation. This would be a really cool thing to have for FXRuby.

- Provide extensions for popular third-party widgets like `FX2DCanvas`.

Prev | Up | Next
Chapter 8. The FXRuby Standard Library | Home | Chapter 10. Change History