Commit 8413ee73 authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

New functions to clear a model.

Tue Jun 19 19:13:19 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtkliststore.c (gtk_list_store_clear):
	* gtk/gtktreestore.c (gtk_tree_store_clear): New functions to
	clear a model.
parent 5ebd1d02
Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_clear):
* gtk/gtktreestore.c (gtk_tree_store_clear): New functions to
clear a model.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
......
Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_clear):
* gtk/gtktreestore.c (gtk_tree_store_clear): New functions to
clear a model.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
......
Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_clear):
* gtk/gtktreestore.c (gtk_tree_store_clear): New functions to
clear a model.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
......
Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_clear):
* gtk/gtktreestore.c (gtk_tree_store_clear): New functions to
clear a model.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
......
Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_clear):
* gtk/gtktreestore.c (gtk_tree_store_clear): New functions to
clear a model.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
......
Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_clear):
* gtk/gtktreestore.c (gtk_tree_store_clear): New functions to
clear a model.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
......
Tue Jun 19 19:13:19 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_clear):
* gtk/gtktreestore.c (gtk_tree_store_clear): New functions to
clear a model.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
......
......@@ -1150,6 +1150,21 @@ gtk_list_store_append (GtkListStore *list_store,
gtk_tree_path_free (path);
}
void
gtk_list_store_clear (GtkListStore *list_store)
{
GtkTreeIter iter;
g_return_if_fail (GTK_IS_LIST_STORE (list_store));
while (list_store->root)
{
iter.stamp = list_store->stamp;
iter.user_data = list_store->root;
gtk_list_store_remove (list_store, &iter);
}
}
static gboolean
gtk_list_store_drag_data_delete (GtkTreeDragSource *drag_source,
GtkTreePath *path)
......@@ -1161,14 +1176,10 @@ gtk_list_store_drag_data_delete (GtkTreeDragSource *drag_source,
&iter,
path))
{
gtk_list_store_remove (GTK_LIST_STORE (drag_source),
&iter);
gtk_list_store_remove (GTK_LIST_STORE (drag_source), &iter);
return TRUE;
}
else
{
return FALSE;
}
return FALSE;
}
static gboolean
......
......@@ -93,7 +93,7 @@ void gtk_list_store_prepend (GtkListStore *store,
GtkTreeIter *iter);
void gtk_list_store_append (GtkListStore *store,
GtkTreeIter *iter);
void gtk_list_store_clear (GtkListStore *store);
#ifdef __cplusplus
......
......@@ -1059,6 +1059,21 @@ gtk_tree_store_iter_depth (GtkTreeStore *model,
return g_node_depth (G_NODE (iter->user_data)) - 1;
}
void
gtk_tree_store_clear (GtkTreeStore *tree_store)
{
GtkTreeIter iter;
g_return_if_fail (GTK_IS_TREE_STORE (tree_store));
while (G_NODE (tree_store->root)->children)
{
iter.stamp = tree_store->stamp;
iter.user_data = G_NODE (tree_store->root)->children;
gtk_tree_store_remove (tree_store, &iter);
}
}
/* DND */
......@@ -1763,3 +1778,4 @@ validate_gnode (GNode* node)
}
......@@ -103,7 +103,7 @@ gboolean gtk_tree_store_is_ancestor (GtkTreeStore *tree_store,
GtkTreeIter *descendant);
gint gtk_tree_store_iter_depth (GtkTreeStore *tree_store,
GtkTreeIter *iter);
void gtk_tree_store_clear (GtkTreeStore *tree_store);
#ifdef __cplusplus
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment