add this function, bug 40251

2001-01-10  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
	add this function, bug 40251

	* gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
	of type macro
This commit is contained in:
Havoc Pennington 2001-01-11 17:59:40 +00:00 committed by Havoc Pennington
parent b29eece81f
commit 69c58e538a
10 changed files with 85 additions and 12 deletions

View File

@ -1,3 +1,11 @@
2001-01-10 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
add this function, bug 40251
* gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
of type macro
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:

View File

@ -1,3 +1,11 @@
2001-01-10 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
add this function, bug 40251
* gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
of type macro
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:

View File

@ -1,3 +1,11 @@
2001-01-10 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
add this function, bug 40251
* gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
of type macro
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:

View File

@ -1,3 +1,11 @@
2001-01-10 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
add this function, bug 40251
* gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
of type macro
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:

View File

@ -1,3 +1,11 @@
2001-01-10 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
add this function, bug 40251
* gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
of type macro
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:

View File

@ -1,3 +1,11 @@
2001-01-10 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
add this function, bug 40251
* gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
of type macro
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:

View File

@ -1,3 +1,11 @@
2001-01-10 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeviewcolumn.c (gtk_tree_view_column_clear_attributes):
add this function, bug 40251
* gtk/gtktreemodelsimple.h (GTK_TYPE_TREE_MODEL_SIMPLE): fix name
of type macro
2001-01-11 Alexander Larsson <alexl@redhat.com>
* acconfig.h:

View File

@ -27,7 +27,7 @@ extern "C" {
#endif /* __cplusplus */
#define GTK_TYPE_MODEL_SIMPLE (gtk_tree_model_simple_get_type ())
#define GTK_TYPE_TREE_MODEL_SIMPLE (gtk_tree_model_simple_get_type ())
#define GTK_TREE_MODEL_SIMPLE(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_MODEL_SIMPLE, GtkTreeModelSimple))
#define GTK_TREE_MODEL_SIMPLE_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_MODEL_SIMPLE, GtkTreeModelSimpleClass))
#define GTK_IS_TREE_MODEL_SIMPLE(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_MODEL_SIMPLE))

View File

@ -495,7 +495,6 @@ static void
gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column,
va_list args)
{
GSList *list;
gchar *attribute;
gint column;
@ -504,16 +503,8 @@ gtk_tree_view_column_set_attributesv (GtkTreeViewColumn *tree_column,
attribute = va_arg (args, gchar *);
list = tree_column->attributes;
while (list && list->next)
{
g_free (list->data);
list = list->next->next;
}
g_slist_free (tree_column->attributes);
tree_column->attributes = NULL;
gtk_tree_view_column_clear_attributes (tree_column);
while (attribute != NULL)
{
column = va_arg (args, gint);
@ -550,6 +541,31 @@ gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
va_end (args);
}
/**
* gtk_tree_view_column_clear_attributes:
* @tree_column: a #GtkTreeViewColumn
*
* Clears all existing attributes previously set with
* gtk_tree_view_column_set_attributes().
**/
void
gtk_tree_view_column_clear_attributes (GtkTreeViewColumn *tree_column)
{
GSList *list;
g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
list = tree_column->attributes;
while (list && list->next)
{
g_free (list->data);
list = list->next->next;
}
g_slist_free (tree_column->attributes);
tree_column->attributes = NULL;
}
/**
* gtk_tree_view_column_set_cell_data:
* @tree_column: A #GtkTreeViewColumn.

View File

@ -95,6 +95,7 @@ void gtk_tree_view_column_add_attribute (GtkTreeViewColumn
gint column);
void gtk_tree_view_column_set_attributes (GtkTreeViewColumn *tree_column,
...);
void gtk_tree_view_column_clear_attributes (GtkTreeViewColumn *tree_column);
void gtk_tree_view_column_set_cell_data (GtkTreeViewColumn *tree_column,
GtkTreeModel *tree_model,
GtkTreeIter *iter);