gtk_tree_view_get_path_at_pos



The attached patch makes gtk_tree_view_get_path_at_pos work on empty models.
OK to commit?

-- 
Victory to the Divine Mother!!
  http://sahajayoga.org
Index: gtktreeview.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeview.c,v
retrieving revision 1.151
diff -u -p -r1.151 gtktreeview.c
--- gtktreeview.c	2001/10/05 17:10:20	1.151
+++ gtktreeview.c	2001/10/12 17:42:32
@@ -8044,7 +8044,6 @@ gtk_tree_view_get_path_at_pos (GtkTreeVi
   gint y_offset;
 
   g_return_val_if_fail (tree_view != NULL, FALSE);
-  g_return_val_if_fail (tree_view->priv->tree != NULL, FALSE);
   g_return_val_if_fail (tree_view->priv->bin_window != NULL, FALSE);
 
   if (window)
@@ -8054,6 +8053,9 @@ gtk_tree_view_get_path_at_pos (GtkTreeVi
     *path = NULL;
   if (column)
     *column = NULL;
+
+  if (tree_view->priv->tree == NULL)
+    return FALSE;
 
   if (x > tree_view->priv->hadjustment->upper)
     return FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]