From 239a12d0d140ad98ac7c85f7aa46411291250dda Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Tue, 10 Mar 1998 02:21:15 +0000 Subject: We now accept the color parameter to be NULL. If it is NULL, it will mark 1998-03-09 Federico Mena Quintero * gtk/gtkclist.c (gtk_clist_set_foreground): We now accept the color parameter to be NULL. If it is NULL, it will mark the row with "color not set", so it will be repainted with the default color. (gtk_clist_set_background): Likewise. --- gtk/gtkclist.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'gtk') diff --git a/gtk/gtkclist.c b/gtk/gtkclist.c index 3cb3860e77..00e40d9a9d 100644 --- a/gtk/gtkclist.c +++ b/gtk/gtkclist.c @@ -1131,34 +1131,45 @@ gtk_clist_set_foreground (GtkCList * clist, GtkCListRow *clist_row; g_return_if_fail (clist != NULL); - g_return_if_fail (color != NULL); if (row < 0 || row >= clist->rows) return; clist_row = (g_list_nth (clist->row_list, row))->data; - clist_row->foreground = *color; - clist_row->fg_set = TRUE; + + if (color) + { + clist_row->foreground = *color; + clist_row->fg_set = TRUE; + } + else + clist_row->fg_set = FALSE; if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_is_visible (clist, row)) draw_row (clist, NULL, row, clist_row); } -void gtk_clist_set_background (GtkCList * clist, - gint row, - GdkColor * color) +void +gtk_clist_set_background (GtkCList * clist, + gint row, + GdkColor * color) { GtkCListRow *clist_row; g_return_if_fail (clist != NULL); - g_return_if_fail (color != NULL); if (row < 0 || row >= clist->rows) return; clist_row = (g_list_nth (clist->row_list, row))->data; - clist_row->background = *color; - clist_row->bg_set = TRUE; + + if (color) + { + clist_row->background = *color; + clist_row->bg_set = TRUE; + } + else + clist_row->bg_set = FALSE; if (!GTK_CLIST_FROZEN (clist) && gtk_clist_row_is_visible (clist, row)) draw_row (clist, NULL, row, clist_row); -- cgit v1.2.1