ANN: FXRuby API Documentation - Preview

All,

I’ve posted a preview (if you’d like to think of it that way) of the
FXRuby API documentation that I’ve been working on here:

 http://www.fxruby.org/doc/api

Because it is still very much a work in progress, you should expect to
find a lot of things missing and so forth; that shortcoming will be
remedied over time. My main concern at this point is to get some
feedback about the format in which the information is provided,
especially from current FXRuby users. Any suggestions on how to better
organize the information is welcome.

Thanks,

Lyle

Lyle Johnson wrote:

All,

I’ve posted a preview (if you’d like to think of it that way) of the
FXRuby API documentation that I’ve been working on here:

http://www.fxruby.org/doc/api

Looks great! This will be be big help.

I’m very glad to see the various constants/enums (events, layout
hints, etc.) together in one place, with descriptions.

One question: sometimes an accessor has a set* method associated with it
(e.g. FXWindow#height= and #setHeight), but the set method is not listed
in the docs. That’s good because it simplifies the docs and encourages
use of the more ruby-like style. But occasionally I like to override the
writer method, and reserve the set method for internal use. (Actually,
it’s just as easy for me to find out what set methods exist using irb,
so I’m not suggesting a change.)

Thanks for the fantastic work, Lyle!

Joel VanderWerf wrote:

One question: sometimes an accessor has a set* method associated with it
(e.g. FXWindow#height= and #setHeight), but the set method is not listed
in the docs. That’s good because it simplifies the docs and encourages
use of the more ruby-like style. But occasionally I like to override the
writer method, and reserve the set method for internal use.

I’m not sure I follow; are you talking about setXXX() methods that are
defined as virtual functions in the C++ library (and are therefore
useful for overloading)? Could you maybe spell it out more slowly for me
:wink: ?

Lyle Johnson wrote:

Joel VanderWerf wrote:

One question: sometimes an accessor has a set* method associated with
it (e.g. FXWindow#height= and #setHeight), but the set method is not
listed in the docs. That’s good because it simplifies the docs and
encourages use of the more ruby-like style. But occasionally I like to
override the writer method, and reserve the set method for internal use.

I’m not sure I follow; are you talking about setXXX() methods that are
defined as virtual functions in the C++ library (and are therefore
useful for overloading)? Could you maybe spell it out more slowly for me
:wink: ?

Sorry… writing too much code and not enough English lately…

I’ve been using irb to look for methods, like this:

irb(main):003:0> FXWindow.instance_methods(1).grep /height/i
[“getDefaultHeight”, “getWidthForHeight”, “getHeightForWidth”,
“defaultHeight”,
“setHeight”, “height=”, “getHeight”, “height”]

But I don’t see “setHeight” in the new documents, just a height
attribute, which is RW.

I’m not sure if I can always assume that any attribute with a writer
#foo= also has a corresponding #setFoo. (They are semantically the same,
right?)

No change is needed, since there’s always irb. As you have it, the docs
are shorter, and encourage reader/writer methods instead of get/set
methods, which are more readable anyway.

It would be nice, though, if there was a way to change the line

:height [RW]

to

:height [RW] also has setHeight, getHeight

Or can we always assume that they exist if the reader/writer does?