Document that @cell must be one of the renderers of the icon view, warn if

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)
This commit is contained in:
Matthias Clasen 2006-03-20 03:16:43 +00:00 committed by Matthias Clasen
parent e420f93158
commit 2941cd5c1a
3 changed files with 30 additions and 17 deletions

View 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> 2006-03-16 Matthias Clasen <mclasen@redhat.com>
* configure.in: Add a missing comma. (#334774, Peter Breitenlohner) * configure.in: Add a missing comma. (#334774, Peter Breitenlohner)

View 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> 2006-03-16 Matthias Clasen <mclasen@redhat.com>
* configure.in: Add a missing comma. (#334774, Peter Breitenlohner) * configure.in: Add a missing comma. (#334774, Peter Breitenlohner)

View File

@ -1720,7 +1720,7 @@ gtk_icon_view_stop_editing (GtkIconView *icon_view,
* gtk_icon_view_set_cursor: * gtk_icon_view_set_cursor:
* @icon_view: A #GtkIconView * @icon_view: A #GtkIconView
* @path: A #GtkTreePath * @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. * @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 * 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) if (!item)
return; return;
cell_pos = -1; cell_pos = -1;
for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++) for (l = icon_view->priv->cell_list, i = 0; l; l = l->next, i++)
{ {
info = l->data; info = l->data;
if (info->cell == cell) if (info->cell == cell)
{ {
cell_pos = i; cell_pos = i;
break; break;
} }
info = NULL; info = NULL;
} }
g_return_if_fail (cell == NULL || info != NULL);
gtk_icon_view_set_cursor_item (icon_view, item, cell_pos); gtk_icon_view_set_cursor_item (icon_view, item, cell_pos);
if (FALSE && GTK_WIDGET_REALIZED (icon_view)) gtk_icon_view_scroll_to_path (icon_view, path, FALSE, 0.0, 0.0);
gtk_icon_view_scroll_to_item (icon_view, item);
else if (info && start_editing)
gtk_icon_view_scroll_to_path (icon_view, path,
FALSE, 0.0, 0.0);
if (start_editing)
gtk_icon_view_start_editing (icon_view, item, info, NULL); 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. * @col_align: The horizontal alignment of the item specified by @path.
* *
* Moves the alignments of @icon_view to the position 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 * @row_align determines where the row is placed, and @col_align determines
* @column is placed. Both are expected to be between 0.0 and 1.0. * 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. * 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 * 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. * 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 * 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. * 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 * This function only works if the model is set, and @path is a valid row on
* model. If the model changes before the @icon_view is realized, the centered * the model. If the model changes before the @icon_view is realized, the
* path will be modified to reflect this change. * centered path will be modified to reflect this change.
* *
* Since: 2.8 * Since: 2.8
**/ **/