Hi Peralta
[email protected] wrote:
I’ve upgraded from 1.9.0 to 1.9.2 and am finding that
the errors I’m getting don’t match the docs. For example,
in Wx::ListCtrl:
-
The doc makes no mention of on_get_item_column_image(),
but without this method I get NoMethodError.
-
The doc says on_get_item_attr() may be overloaded,
but if I don’t define it, I get NoMethodError.
Thanks for the report; the docs are right and the library is wrong. I
had meant to check in a patch for this a while back but forgot. It
should be fixed now for 1.9.3. The changed file is here:
http://wxruby.rubyforge.org/svn/trunk/wxruby2/lib/wx/classes/listctrl.rb
The API doc appears to be rife with inconsistencies like
this. Is anyone working on updating it?
No-one is working on it, in the same sense as no-one is working on
wxRuby as a whole. There is a small team of volunteers who, in their
spare time, make additions and corrections to the docs with each
release, as well as developing the library, providing binary builds, and
helping on the mailing lists. And, even, occasionally working on their
own projects.
Sorry if this sounds bad-tempered, but there is no way that a small dev
team can stop and work through several hundred pages worth of docs. This
is partly why many Ruby GUI projects don’t have dedicated Ruby docs. I
don’t think wxRuby’s are “rife” with errors, but because of the scale of
the docs we’re reliant on users helping us and each other by pointing
them out.
Patches to fix the docs are great
(http://wxruby.rubyforge.org/wiki/wiki.pl?DocumentingWxRuby) but a
simple list of references to all the mistakes you’ve found would be a
massive help, and gratefully received.
Also, the Wx::Sizer page has a broken link to “Sizer
overview”. Oh how I need that overview
Sizers are powerful, but not intuitive at first glance. You might have a
look at:
http://wxruby.rubyforge.org/wiki/wiki.pl?Using_Sizers_For_Layout
http://www.wxwidgets.org/manuals/stable/wx_sizeroverview.html
Alternatively, you might consider using XRC (XML layouts, designed in a
visual editor) or the ‘layout’ library from WxSugar. Both of these
enable you to get the benefits of Sizer-based layout, without having to
deal with the slightly clumsy API.
cheers
alex