Automatic GObject Derivation in Ruby
Edd Dumbill’s been experimenting with Ruby-GNOME lately, and notes that unlike the C# binding, ruby-glib2 doesn’t automatically derive a GObject class for every GLib::Object-derived Ruby class. To get a new underlying GObject class, you’ve got to explicitly call type_register on the Ruby class in question.
Why is that? Automatic GObject derivation in Ruby is certainly easy enough:
def (GLib::Object).inherited( c )
super
c.class_eval { type_register }
end
I’ve tried this and (at quick glance) it seems to work, too…