jhass / crystal-gobject

gobject-introspection for Crystal
BSD 3-Clause "New" or "Revised" License
127 stars 13 forks source link

About Container#children method #62

Closed viachpaliy closed 4 years ago

viachpaliy commented 4 years ago

I use XUbuntu19.10 (gir1.2-freedesktop 1.62.0-1) Compile-time bindings has follow code :

def children
      __return_value = LibGtk.container_get_children(@pointer.as(LibGtk::Container*))
      GObject.raise_unexpected_null("gtk_container_get_children") if __return_value.null?
      GLib::ListIterator(Gtk::Widget, LibGtk::Widget*).new(GLib::SList.new(__return_value.as(LibGLib::List*)))
    end

Matter in

GLib::SList.new

because

LibGtk.container_get_children

returns

LibGLib::List*

In my opinion, this method must have code as is follow:

def children
      __return_value = LibGtk.container_get_children(@pointer.as(LibGtk::Container*))
      GObject.raise_unexpected_null("gtk_container_get_children") if __return_value.null?
      GLib::ListIterator(Gtk::Widget, LibGtk::Widget*).new(GLib::List.new(__return_value.as(LibGLib::List*)))
    end
jhass commented 4 years ago

Good catch, I guess that was a copy paste error back in https://github.com/jhass/crystal-gobject/commit/b27e76925957f3702842d101da76f26c6f0e8a9a#diff-15cebc9b597659fa2b5a82fd0847ed44R111

Thanks for actually testing it :D