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
’
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