Re: [Fxruby-users] New to list - general questions...
Status: Inactive
Brought to you by:
lyle
|
From: <ly...@kn...> - 2003-06-05 14:47:27
|
On Thu, 5 Jun 2003 11:06:00 +0100 (BST), Hugh Sasse Staff Elec Eng
<hg...@dm...> wrote :
> My questions that I have now are:
>
> The archive for the list seems to have only 2 messages in it. Is
> that correct?
Yes. The list was only created the day before yesterday ;)
> There seems to be no FAQ for the list, and no FXRuby FAQ on the
> fxruby site. Since I'm trying to learn this stuff I'm happy to
> create one. Most of the FAQ tools I've heard of seem to be
> perlisms, so the obvious question is: What ruby ones exist?
There is a general FOX FAQ at the FOX web site:
http://www.fox-toolkit.org/faq.html
as well as the FAQ at the FOX Community Wiki:
http://www.fifthplanet.net/cgi-bin/wiki.pl?FAQ
but you are correct that we don't have a FAQ list dedicated specifically to
FXRuby. I guess part of the challenge will be figuring out which questions
are FXRuby-specific and which questions are more in the domain of FOX
programming in general. For example, the FAQ about calling create() on
windows, icons, etc. after the application's already running is a problem
that any FOX programmer will confront at some point, whether he's using
FXRuby, FXPy, EiffelFOX or, worst case, C++ ;)
> And onto FXRuby itself: Most of the API calls wrap C++ pretty
> closely, so that they are often FXThingy.method(*args). I can
> explore (and will do) the FOX docs some more, but are there mappings
> within the ruby so that Ruby "types" like integer get converted to
> FXinteger, or does one have to create the objects explicitly? I
> don't think I'd be able to infer this from looking at C++ docs.
Yes, for the most part it should be a very obvious mapping from C++ to Ruby.
If the C++ function expects a signed or unsigned integer type (i.e. FXshort,
FXushort, FXint or FXuint) the Ruby method probably expects an Integer. If
the C++ function expects a floating point type, you should be able to pass
in *any* Ruby number. If the C++ function expects an FXString, you should be
able to pass in a Ruby String. Of course, there are some differences as
well, such as how arrays of values are passed back and forth. For a good
summary of the kinds of differences to expect, see this chapter from the
FXRuby documentation:
http://www.fxruby.org/doc/differences.html
Also, your first stop for reference documentation on the Ruby API should be
the docs found here:
http://www.fxruby.org/doc/api
The problem is that those are still under construction (although I'm getting
closer!). Use the C++ library's reference documentation as a fallback.
Hope this helps,
Lyle
|