+Fri Mar 1 10:31:14 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_reorder_child):
+ Fix signed-unsigned error that was accidentally causing
+ negative values to append, do it intentionally. Fix docs
+ to say that negative values append. (Alexey A. Malyshev,
+ #73108)
+
2002-03-01 Alexey Malyshev <maa@sparc.spb.su>
* gtk+/gtk/gtkitemfactory.c
+Fri Mar 1 10:31:14 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_reorder_child):
+ Fix signed-unsigned error that was accidentally causing
+ negative values to append, do it intentionally. Fix docs
+ to say that negative values append. (Alexey A. Malyshev,
+ #73108)
+
2002-03-01 Alexey Malyshev <maa@sparc.spb.su>
* gtk+/gtk/gtkitemfactory.c
+Fri Mar 1 10:31:14 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_reorder_child):
+ Fix signed-unsigned error that was accidentally causing
+ negative values to append, do it intentionally. Fix docs
+ to say that negative values append. (Alexey A. Malyshev,
+ #73108)
+
2002-03-01 Alexey Malyshev <maa@sparc.spb.su>
* gtk+/gtk/gtkitemfactory.c
+Fri Mar 1 10:31:14 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_reorder_child):
+ Fix signed-unsigned error that was accidentally causing
+ negative values to append, do it intentionally. Fix docs
+ to say that negative values append. (Alexey A. Malyshev,
+ #73108)
+
2002-03-01 Alexey Malyshev <maa@sparc.spb.su>
* gtk+/gtk/gtkitemfactory.c
+Fri Mar 1 10:31:14 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_reorder_child):
+ Fix signed-unsigned error that was accidentally causing
+ negative values to append, do it intentionally. Fix docs
+ to say that negative values append. (Alexey A. Malyshev,
+ #73108)
+
2002-03-01 Alexey Malyshev <maa@sparc.spb.su>
* gtk+/gtk/gtkitemfactory.c
+Fri Mar 1 10:31:14 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_reorder_child):
+ Fix signed-unsigned error that was accidentally causing
+ negative values to append, do it intentionally. Fix docs
+ to say that negative values append. (Alexey A. Malyshev,
+ #73108)
+
2002-03-01 Alexey Malyshev <maa@sparc.spb.su>
* gtk+/gtk/gtkitemfactory.c
+Fri Mar 1 10:31:14 2002 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtknotebook.c (gtk_notebook_reorder_child):
+ Fix signed-unsigned error that was accidentally causing
+ negative values to append, do it intentionally. Fix docs
+ to say that negative values append. (Alexey A. Malyshev,
+ #73108)
+
2002-03-01 Alexey Malyshev <maa@sparc.spb.su>
* gtk+/gtk/gtkitemfactory.c
* gtk_notebook_reorder_child:
* @notebook: a #GtkNotebook
* @child: the child to move
- * @position: the new position
+ * @position: the new position, or -1 to move to the end
*
* Reorders the page containing @child, so that it appears in position
- * @position. Out of bounds @position will be clamped.
+ * @position. If @position is greater than or equal to the number of
+ * children in the list or negative, @child will be moved to the end
+ * of the list.
**/
void
gtk_notebook_reorder_child (GtkNotebook *notebook,
GList *list, *new_list;
GtkNotebookPage *page;
gint old_pos;
+ gint max_pos;
g_return_if_fail (GTK_IS_NOTEBOOK (notebook));
g_return_if_fail (GTK_IS_WIDGET (child));
if (!list)
return;
+ max_pos = g_list_length (notebook->children) - 1;
+ if (position < 0 || position > max_pos)
+ position = max_pos;
+
old_pos = g_list_position (notebook->children, list);
if (old_pos == position)
page = list->data;
notebook->children = g_list_delete_link (notebook->children, list);
- position = CLAMP (position, 0, g_list_length (notebook->children));
-
notebook->children = g_list_insert (notebook->children, page, position);
new_list = g_list_nth (notebook->children, position);