Ruby Forum wxRuby > Wx::StatusBar set_status_widths returns argument error

Posted by Zhimin Zhan (zzhan)
on 05.08.2008 02:44
Hi,

I added the following line in samples/wxStatusBar.rbw
  set_status_widths(1, 100)  # Doc: set_status_widths(Integer n, Integer
widths)

Got error:
  wxStatusBar.rbw:17:in `set_status_widths': wrong # of arguments(2 for
1) (ArgumentError)

wxRuby version: wxruby-1.9.6-x86-mingw32.

Thanks in advance.

Regards,
Zhimin
Posted by Alex Fenton (Guest)
on 05.08.2008 13:18
(Received via mailing list)
Hi

Zhimin Zhan wrote:
> I added the following line in samples/wxStatusBar.rbw
>   set_status_widths(1, 100)  # Doc: set_status_widths(Integer n, Integer
> widths)
>
> Got error:
>   wxStatusBar.rbw:17:in `set_status_widths': wrong # of arguments(2 for
> 1) (ArgumentError)
>   
It's a mistake in the documentation (which was originally automatically
converted from C++). Thanks for reporting this so we can correct it.

The propoer argument should simply be an array of widths. Eg, if you
wanted two fields of 150px and 250px, call it like this:

set_status_widths [150, 250]
OR
self.status_widths = [150, 250]

a