-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to instantiate Gtk::TreeModelFilter #1298
Comments
Could you show a whole script that reproduces this case instead of code snippet? |
Thx, for the fast reply! Actually this already reproduces the case in Ruby 2.5.0:
|
Thanks. diff --git a/gtk/gtktreemodelsort.c b/gtk/gtktreemodelsort.c
index 2e3b808e75..4376365837 100644
--- a/gtk/gtktreemodelsort.c
+++ b/gtk/gtktreemodelsort.c
@@ -529,14 +529,14 @@ gtk_tree_model_sort_drag_source_init (GtkTreeDragSourceIface *iface)
* gtk_tree_model_sort_new_with_model:
* @child_model: A #GtkTreeModel
*
- * Creates a new #GtkTreeModel, with @child_model as the child model.
+ * Creates a new #GtkTreeModelSort, with @child_model as the child model.
*
- * Returns: (transfer full): A new #GtkTreeModel.
+ * Returns: (transfer full): A new #GtkTreeModelSort.
*/
-GtkTreeModel *
+GtkTreeModelSort *
gtk_tree_model_sort_new_with_model (GtkTreeModel *child_model)
{
- GtkTreeModel *retval;
+ GtkTreeModelSort *retval;
g_return_val_if_fail (GTK_IS_TREE_MODEL (child_model), NULL);
diff --git a/gtk/gtktreemodelsort.h b/gtk/gtktreemodelsort.h
index 568372efb3..95742f499f 100644
--- a/gtk/gtktreemodelsort.h
+++ b/gtk/gtktreemodelsort.h
@@ -59,7 +59,7 @@ struct _GtkTreeModelSortClass
GDK_AVAILABLE_IN_ALL
GType gtk_tree_model_sort_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
-GtkTreeModel *gtk_tree_model_sort_new_with_model (GtkTreeModel *child_model);
+GtkTreeModelSort *gtk_tree_model_sort_new_with_model (GtkTreeModel *child_model);
GDK_AVAILABLE_IN_ALL
GtkTreeModel *gtk_tree_model_sort_get_model (GtkTreeModelSort *tree_model); Related issue: https://gitlab.gnome.org/GNOME/gtk/issues/1077 |
I've added a workaround for this case to master for now. |
Thx, for the quick reply and the workaround. Works fine now. |
|
Thx! Currently failing at step one but I will persist! :) |
Unfortunately it does not build. :( |
Finally success! It got merged! 😄 |
Great! |
I have a Gtk::TreeStore (my_tree_store) that I want to be able to sort and filter.
When I try this:
Gtk::TreeModelSort.new(Gtk::TreeModelFilter.new(my_tree_store))
I get
wrong argument type Gtk::TreeModelFilter (expected Hash) (TypeError)
although the docs say Gtk::TreeModelFilter is instantiated with a TreeModel.
The text was updated successfully, but these errors were encountered: