]> Pileus Git - ~andy/gtk/commitdiff
Document that @cell must be one of the renderers of the icon view, warn if
authorMatthias Clasen <mclasen@redhat.com>
Mon, 20 Mar 2006 03:16:43 +0000 (03:16 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 20 Mar 2006 03:16:43 +0000 (03:16 +0000)
2006-03-19  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkiconview.c (gtk_icon_view_set_cursor): Document that
@cell must be one of the renderers of the icon view, warn if
it is not, and ignore @start_editing if @cell is not set.
(#335001, Emmanuel Rodriguez)

ChangeLog
ChangeLog.pre-2-10
gtk/gtkiconview.c

index ed461ecc99f4c50772f1f02b1da62a02c6288d0f..7f5fc1925973a8a5243d0649e49a3f98d299c3eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-03-19  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkiconview.c (gtk_icon_view_set_cursor): Document that
+       @cell must be one of the renderers of the icon view, warn if 
+       it is not, and ignore @start_editing if @cell is not set.
+       (#335001, Emmanuel Rodriguez)
+
 2006-03-16  Matthias Clasen  <mclasen@redhat.com>
 
        * configure.in: Add a missing comma.  (#334774, Peter Breitenlohner)
index ed461ecc99f4c50772f1f02b1da62a02c6288d0f..7f5fc1925973a8a5243d0649e49a3f98d299c3eb 100644 (file)
@@ -1,3 +1,10 @@
+2006-03-19  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkiconview.c (gtk_icon_view_set_cursor): Document that
+       @cell must be one of the renderers of the icon view, warn if 
+       it is not, and ignore @start_editing if @cell is not set.
+       (#335001, Emmanuel Rodriguez)
+
 2006-03-16  Matthias Clasen  <mclasen@redhat.com>
 
        * configure.in: Add a missing comma.  (#334774, Peter Breitenlohner)
index b33395c7a930673152042f113b75cb8bb92d6e3d..88c40ae305b79f9d6fcab3fe9bb84fd1cf2f3726 100644 (file)
@@ -1720,7 +1720,7 @@ gtk_icon_view_stop_editing (GtkIconView *icon_view,
  * gtk_icon_view_set_cursor:
  * @icon_view: A #GtkIconView
  * @path: A #GtkTreePath
- * @cell: A #GtkCellRenderer or %NULL
+ * @cell: One of the cell renderers of @icon_view, or %NULL
  * @start_editing: %TRUE if the specified cell should start being edited.
  *
  * Sets the current keyboard focus to be at @path, and selects it.  This is
@@ -1758,29 +1758,27 @@ gtk_icon_view_set_cursor (GtkIconView     *icon_view,
   
   if (!item)
     return;
-  
+
   cell_pos = -1;
   for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
     {
       info = l->data;
-
+      
       if (info->cell == cell)
        {
          cell_pos = i;
          break;
        }
-
+         
       info = NULL;
     }
+  
+  g_return_if_fail (cell == NULL || info != NULL);
 
   gtk_icon_view_set_cursor_item (icon_view, item, cell_pos);
-  if (FALSE && GTK_WIDGET_REALIZED (icon_view))
-    gtk_icon_view_scroll_to_item (icon_view, item);
-  else
-    gtk_icon_view_scroll_to_path (icon_view, path,
-                                 FALSE, 0.0, 0.0);
-
-  if (start_editing)
+  gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.0, 0.0);
+  
+  if (info && start_editing)
     gtk_icon_view_start_editing (icon_view, item, info, NULL);
 }
 
@@ -3944,18 +3942,19 @@ gtk_icon_view_move_cursor_start_end (GtkIconView *icon_view,
  * @col_align: The horizontal alignment of the item specified by @path.
  *
  * Moves the alignments of @icon_view to the position specified by @path.  
- * @row_align determines where the row is placed, and @col_align determines where 
- * @column is placed.  Both are expected to be between 0.0 and 1.0. 
- * 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means center.
+ * @row_align determines where the row is placed, and @col_align determines 
+ * where @column is placed.  Both are expected to be between 0.0 and 1.0. 
+ * 0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 means 
+ * center.
  *
  * If @use_align is %FALSE, then the alignment arguments are ignored, and the
  * tree does the minimum amount of work to scroll the item onto the screen.
  * This means that the item will be scrolled to the edge closest to its current
  * position.  If the item is currently visible on the screen, nothing is done.
  *
- * This function only works if the model is set, and @path is a valid row on the
- * model.  If the model changes before the @icon_view is realized, the centered
- * path will be modified to reflect this change.
+ * This function only works if the model is set, and @path is a valid row on 
+ * the model. If the model changes before the @icon_view is realized, the 
+ * centered path will be modified to reflect this change.
  *
  * Since: 2.8
  **/