diff options
author | Sébastien Wilmet <swilmet@gnome.org> | 2014-08-20 17:13:46 +0200 |
---|---|---|
committer | Sébastien Wilmet <swilmet@gnome.org> | 2014-08-20 17:19:30 +0200 |
commit | 7bc819e88d8880487653740f55e9bf072d5de36e (patch) | |
tree | 63cb21b886195156fe4c6d992341aae87cd18c17 /testsuite | |
parent | 55bd34c62ae563aff25d381df36f569756ba143b (diff) | |
download | gtk+-7bc819e88d8880487653740f55e9bf072d5de36e.tar.gz |
tests textbuffer: don't use GdkColor (deprecated)
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gtk/textbuffer.c | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/testsuite/gtk/textbuffer.c b/testsuite/gtk/textbuffer.c index 50f50acaca..3d8d872509 100644 --- a/testsuite/gtk/textbuffer.c +++ b/testsuite/gtk/textbuffer.c @@ -633,37 +633,44 @@ static void fill_buffer (GtkTextBuffer *buffer) { GtkTextTag *tag; - GdkColor color, color2; + GdkRGBA color; + GdkRGBA color2; GtkTextIter iter; GtkTextIter iter2; GdkPixbuf *pixbuf; int i; - color.red = color.green = 0; - color.blue = 0xffff; - color2.red = 0xfff; - color2.blue = 0x0; - color2.green = 0; - + color.red = 0.0; + color.green = 0.0; + color.blue = 1.0; + color.alpha = 1.0; + + color2.red = 1.0; + color2.green = 0.0; + color2.blue = 0.0; + color2.alpha = 1.0; + gtk_text_buffer_create_tag (buffer, "fg_blue", - "foreground_gdk", &color, - "background_gdk", &color2, + "foreground_rgba", &color, + "background_rgba", &color2, "font", "-*-courier-bold-r-*-*-30-*-*-*-*-*-*-*", NULL); - color.blue = color.green = 0; - color.red = 0xffff; - + color.red = 1.0; + color.green = 0.0; + color.blue = 0.0; + gtk_text_buffer_create_tag (buffer, "fg_red", "rise", -4, - "foreground_gdk", &color, + "foreground_rgba", &color, NULL); - color.blue = color.red = 0; - color.green = 0xffff; - + color.red = 0.0; + color.green = 1.0; + color.blue = 0.0; + gtk_text_buffer_create_tag (buffer, "bg_green", - "background_gdk", &color, + "background_rgba", &color, "font", "-*-courier-bold-r-*-*-10-*-*-*-*-*-*-*", NULL); @@ -671,8 +678,7 @@ fill_buffer (GtkTextBuffer *buffer) g_assert (pixbuf != NULL); - i = 0; - while (i < 10) + for (i = 0; i < 10; i++) { gchar *str; @@ -752,8 +758,6 @@ fill_buffer (GtkTextBuffer *buffer) gtk_text_buffer_remove_tag_by_name (buffer, "fg_red", &iter, &iter2); gtk_text_buffer_remove_tag_by_name (buffer, "fg_blue", &iter, &iter2); - - ++i; } /* Put in tags that are just at the beginning, and just near the end, |