Forum: Ruby-Gnome 2 [BUG] type_register and ruby 1.9

Posted by Simon Arnaud (sarnaud)
on 2009-10-09 17:48
Hi, there seems to be a bug when using type_register with ruby 1.9 :

sarnaud@NNAN0022:~/src/ruby-gnome2-all-0.19.3/gtk/sample/misc$ ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [x86_64-linux]
sarnaud@NNAN0022:~/src/ruby-gnome2-all-0.19.3/gtk/sample/misc$ ruby
properties.rb
properties.rb:22:in `each': can't convert String into Integer
(TypeError)
  from properties.rb:22:in `each_with_index'
  from properties.rb:22:in `initialize'
  from properties.rb:22:in `initialize'
  from properties.rb:69:in `new'
  from properties.rb:69:in `<main>'

while it works ok with 1.8 :

sarnaud@NNAN0022:~/src/ruby-gnome2-all-0.19.3/gtk/sample/misc$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
sarnaud@NNAN0022:~/src/ruby-gnome2-all-0.19.3/gtk/sample/misc$ ruby
properties.rb
#<MyButton:0x7f44d8c32660 ptr=0x1b72820>
"Hello"
GLib::Type["MyButton"]
...
...
[MyButton, MyButton::RubyGtkContainerHook__, Gtk::Button,
#<Module:0x7f44dbb9f358>, Gtk::Bin, Gtk::Container, Gtk::Widget,
Gtk::Buildable, Atk::Implementor, GLib::Interface, Gtk::Object,
GLib::InitiallyUnowned, GLib::Object, GLib::Instantiatable, Object,
Kernel]

Moreover, the error message does not really points at the right place.
It always report the line which is calling 'super'.

regards

Simon
Posted by Kouhei Sutou (Guest)
on 2009-10-11 07:22
(Received via mailing list)
Hi,

In <f6f93de1d8b36a2a49935fcf927f188c@ruby-forum.com>
  "[ruby-gnome2-devel-en] [BUG] type_register and ruby 1.9" on Fri, 9 
Oct 2009 17:48:26 +0200,
  Simon Arnaud <ruby-forum-incoming@andreas-s.net> wrote:

>   from properties.rb:22:in `initialize'
>   from properties.rb:69:in `new'
>   from properties.rb:69:in `<main>'

Thanks for reporting.
I've fixed it in trunk.

--
kou
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.