From d781c5c9bdb441d2ae99df0bcb34fe73e6564b94 Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Sun, 2 Dec 2012 10:04:28 +0100 Subject: [PATCH] Do not use deprecated gtk_color_button_{get,set}_rgba() Since Gtk 3.4, gtk_color_button_get_rgba() and gtk_color_button_set_rgba() have been deprecated. --- glib/demo/selections.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/glib/demo/selections.c b/glib/demo/selections.c index 0e0d709..7ff17cd 100644 --- a/glib/demo/selections.c +++ b/glib/demo/selections.c @@ -336,9 +336,17 @@ pgd_selections_drawing_area_realize (GtkWidget *area, g_object_set (area, "has-tooltip", TRUE, NULL); gtk_style_context_get_color (style_context, GTK_STATE_FLAG_SELECTED, &rgba); +#if GTK_CHECK_VERSION(3,4,0) + gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (demo->fg_color_button), &rgba); +#else gtk_color_button_set_rgba (GTK_COLOR_BUTTON (demo->fg_color_button), &rgba); +#endif gtk_style_context_get_background_color (style_context, GTK_STATE_FLAG_SELECTED, &rgba); +#if GTK_CHECK_VERSION(3,4,0) + gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (demo->bg_color_button), &rgba); +#else gtk_color_button_set_rgba (GTK_COLOR_BUTTON (demo->bg_color_button), &rgba); +#endif } static gboolean @@ -457,7 +465,11 @@ pgd_selections_fg_color_changed (GtkColorButton *button, { GdkRGBA color; +#if GTK_CHECK_VERSION(3,4,0) + gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color); +#else gtk_color_button_get_rgba (GTK_COLOR_BUTTON (button), &color); +#endif demo->glyph_color.red = CLAMP ((guint) (color.red * 65535), 0, 65535); demo->glyph_color.green = CLAMP ((guint) (color.green * 65535), 0, 65535); demo->glyph_color.blue = CLAMP ((guint) (color.blue * 65535), 0, 65535); @@ -470,7 +482,11 @@ pgd_selections_bg_color_changed (GtkColorButton *button, { GdkRGBA color; +#if GTK_CHECK_VERSION(3,4,0) + gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (button), &color); +#else gtk_color_button_get_rgba (GTK_COLOR_BUTTON (button), &color); +#endif demo->background_color.red = CLAMP ((guint) (color.red * 65535), 0, 65535); demo->background_color.green = CLAMP ((guint) (color.green * 65535), 0, 65535); demo->background_color.blue = CLAMP ((guint) (color.blue * 65535), 0, 65535); -- 1.7.5.4