spk121 / guile-gi

Bindings for GObject Introspection and libgirepository for Guile
GNU General Public License v3.0
58 stars 7 forks source link

(gtk) tree-model:filter-new return type is wrong #99

Closed daym closed 3 years ago

daym commented 3 years ago
scheme@(guix-user)> ,use (gi repository)
scheme@(guix-user)> (require "Gtk" "3.0")
scheme@(guix-user)> (load-by-name "Gtk" "TreeModel")
scheme@(guix-user)> (load-by-name "Gtk" "TreeStore")
scheme@(guix-user)> (tree-model-filter:set-visible-func
  (tree-model:filter-new (tree-store:new (vector <string>)))
  (lambda args #t))

fails because the result of tree-model:filter-new neither is a GtkTreeModelFilter nor can be safely converted to it.

daym commented 3 years ago

Gtk-3.0.gir has this:

<interface name="TreeModel" [...]>
      <method name="filter_new" c:identifier="gtk_tree_model_filter_new" [...]>
        <return-value transfer-ownership="full">
          <doc xml:space="preserve"
               filename="gtktreemodelfilter.c"
               line="3765">A new #GtkTreeModel.</doc>
          <type name="TreeModel" c:type="GtkTreeModel*"/>
        </return-value>
</interface>
<class name="TreeModelFilter" [...]>
   <method name="refilter"
[...]

That cannot work since:

daym commented 3 years ago

Upstream bug report https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/364 Upstream gtk merge request: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2763

daym commented 3 years ago

Workaround: (make <GtkTreeModelFilter> #:child-model xxx #:virtual-root xxx)